Skip to content

Commit

Permalink
add variable, and secret tables to migration
Browse files Browse the repository at this point in the history
  • Loading branch information
arash77 committed Dec 19, 2024
1 parent 25d04ae commit 24bbcf2
Showing 1 changed file with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""

from sqlalchemy import (
Boolean,
Column,
DateTime,
Integer,
Expand All @@ -26,7 +27,8 @@

user_credentials_table = "user_credentials"
user_credentials_group_table = "user_credentials_group"
credential_table = "credential"
variable_table = "variable"
secret_table = "secret"


def upgrade():
Expand All @@ -50,17 +52,25 @@ def upgrade():
Column("update_time", DateTime),
)
create_table(
credential_table,
variable_table,
Column("id", Integer, primary_key=True),
Column("name", TrimmedString(255)),
Column("type", TrimmedString(255)),
Column("value", TrimmedString(255)),
Column("create_time", DateTime),
Column("update_time", DateTime),
)
create_table(
secret_table,
Column("id", Integer, primary_key=True),
Column("name", TrimmedString(255)),
Column("already_set", Boolean),
Column("create_time", DateTime),
Column("update_time", DateTime),
)


def downgrade():
drop_table(user_credentials_table)
drop_table(user_credentials_group_table)
drop_table(credential_table)
drop_table(variable_table)
drop_table(secret_table)

0 comments on commit 24bbcf2

Please sign in to comment.