Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save initial migration #134

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Loading