Skip to content

Commit

Permalink
Merge pull request #134 from mekanix/feature/fix-tests
Browse files Browse the repository at this point in the history
Save initial migration
  • Loading branch information
mekanix authored Apr 3, 2024
2 parents ac9f024 + c0dc143 commit 6db20a9
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 2 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ ansible/site.yml
!ansible/roles/.keep
!ansible/roles/devel

alembic/versions/*
build
cbsd.conf
coverage.xml
Expand Down
90 changes: 90 additions & 0 deletions alembic/versions/06a043f2516a_initial.py
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 ###
2 changes: 1 addition & 1 deletion freenit/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.3.0"
__version__ = "0.3.1"

0 comments on commit 6db20a9

Please sign in to comment.