-
Notifications
You must be signed in to change notification settings - Fork 5
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 #134 from mekanix/feature/fix-tests
Save initial migration
- Loading branch information
Showing
3 changed files
with
91 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
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,90 @@ | ||
"""initial | ||
Revision ID: 06a043f2516a | ||
Revises: | ||
Create Date: 2024-04-03 16:39:58.082206 | ||
""" | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "06a043f2516a" | ||
down_revision = None | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table( | ||
"roles", | ||
sa.Column("id", sa.Integer(), nullable=False), | ||
sa.Column("name", sa.Text(), nullable=False), | ||
sa.PrimaryKeyConstraint("id"), | ||
sa.UniqueConstraint("name"), | ||
) | ||
op.create_table( | ||
"themes", | ||
sa.Column("id", sa.Integer(), nullable=False), | ||
sa.Column("name", sa.Text(), nullable=False), | ||
sa.Column("bg_color", sa.Text(), nullable=False), | ||
sa.Column("bg_secondary_color", sa.Text(), nullable=False), | ||
sa.Column("color_primary", sa.Text(), nullable=False), | ||
sa.Column("color_lightGrey", sa.Text(), nullable=False), | ||
sa.Column("color_grey", sa.Text(), nullable=False), | ||
sa.Column("color_darkGrey", sa.Text(), nullable=False), | ||
sa.Column("color_error", sa.Text(), nullable=False), | ||
sa.Column("color_success", sa.Text(), nullable=False), | ||
sa.Column("grid_maxWidth", sa.Text(), nullable=False), | ||
sa.Column("grid_gutter", sa.Text(), nullable=False), | ||
sa.Column("font_size", sa.Text(), nullable=False), | ||
sa.Column("font_color", sa.Text(), nullable=False), | ||
sa.Column("font_family_sans", sa.Text(), nullable=False), | ||
sa.Column("font_family_mono", sa.Text(), nullable=False), | ||
sa.PrimaryKeyConstraint("id"), | ||
sa.UniqueConstraint("name"), | ||
) | ||
op.create_table( | ||
"users", | ||
sa.Column("id", sa.Integer(), nullable=False), | ||
sa.Column("email", sa.Text(), nullable=False), | ||
sa.Column("password", sa.Text(), nullable=False), | ||
sa.Column("active", sa.Boolean(), nullable=True), | ||
sa.Column("admin", sa.Boolean(), nullable=True), | ||
sa.PrimaryKeyConstraint("id"), | ||
sa.UniqueConstraint("email"), | ||
) | ||
op.create_table( | ||
"users_roles", | ||
sa.Column("id", sa.Integer(), nullable=False), | ||
sa.Column("role", sa.Integer(), nullable=True), | ||
sa.Column("user", sa.Integer(), nullable=True), | ||
sa.ForeignKeyConstraint( | ||
["role"], | ||
["roles.id"], | ||
name="fk_users_roles_roles_role_id", | ||
onupdate="CASCADE", | ||
ondelete="CASCADE", | ||
), | ||
sa.ForeignKeyConstraint( | ||
["user"], | ||
["users.id"], | ||
name="fk_users_roles_users_user_id", | ||
onupdate="CASCADE", | ||
ondelete="CASCADE", | ||
), | ||
sa.PrimaryKeyConstraint("id"), | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_table("users_roles") | ||
op.drop_table("users") | ||
op.drop_table("themes") | ||
op.drop_table("roles") | ||
# ### end Alembic commands ### |
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 |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.3.0" | ||
__version__ = "0.3.1" |