-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #170 from tsugumi-sys/feature/adding-wiki-sp500-table
Database: Adding wiki sp500 table
- Loading branch information
Showing
2 changed files
with
73 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
stocklake/stores/db_migrations/versions/c8deb56c7d92_adding_wikisp500_table.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
"""adding wikisp500 table | ||
Revision ID: c8deb56c7d92 | ||
Revises: 84fb754ea7f6 | ||
Create Date: 2024-07-07 10:15:09.525907 | ||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "c8deb56c7d92" | ||
down_revision: Union[str, None] = "84fb754ea7f6" | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table( | ||
"wiki_sp500", | ||
sa.Column("id", sa.Integer(), nullable=False), | ||
sa.Column("created_at", sa.DateTime(timezone=True), nullable=True), | ||
sa.Column("updated_at", sa.DateTime(timezone=True), nullable=True), | ||
sa.Column("symbol", sa.String(), nullable=True), | ||
sa.Column("company", sa.String(), nullable=True), | ||
sa.Column("sector", sa.String(), nullable=True), | ||
sa.Column("industry", sa.String(), nullable=True), | ||
sa.Column("headquarters", sa.String(), nullable=True), | ||
sa.PrimaryKeyConstraint("id"), | ||
) | ||
op.add_column( | ||
"polygonapi_financials_data", | ||
sa.Column("created_at", sa.DateTime(timezone=True), nullable=True), | ||
) | ||
op.add_column( | ||
"polygonapi_financials_data", | ||
sa.Column("updated_at", sa.DateTime(timezone=True), nullable=True), | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_column("polygonapi_financials_data", "updated_at") | ||
op.drop_column("polygonapi_financials_data", "created_at") | ||
op.drop_table("wiki_sp500") | ||
# ### end Alembic commands ### |