-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
97 additions
and
3 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
34 changes: 34 additions & 0 deletions
34
flexmeasures/data/migrations/versions/2ac7fb39ce0c_add_attribute_column_to_data_source.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,34 @@ | ||
"""add attribute column to data source | ||
Revision ID: 2ac7fb39ce0c | ||
Revises: d814c0688ae0 | ||
Create Date: 2023-06-05 23:41:31.788961 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "2ac7fb39ce0c" | ||
down_revision = "d814c0688ae0" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# add the column `attributes` to the table `data_source` | ||
op.add_column( | ||
"data_source", | ||
sa.Column("attributes", sa.JSON(), nullable=True, default={}), | ||
) | ||
|
||
# add the column `attributes_hash` to the table `data_source` | ||
op.add_column( | ||
"data_source", | ||
sa.Column("attributes_hash", sa.LargeBinary(length=256), nullable=True), | ||
) | ||
|
||
|
||
def downgrade(): | ||
pass |
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
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