-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add user credentials, user credentials group, variable, and secret ta…
…bles to migration
- Loading branch information
Showing
1 changed file
with
77 additions
and
0 deletions.
There are no files selected for viewing
77 changes: 77 additions & 0 deletions
77
lib/galaxy/model/migrations/alembic/versions_gxy/64ee692df15b_add_user_credentials_table.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,77 @@ | ||
"""add user credentials table | ||
Revision ID: 64ee692df15b | ||
Revises: 75348cfb3715 | ||
Create Date: 2024-12-19 10:38:04.970502 | ||
""" | ||
|
||
from sqlalchemy import ( | ||
Boolean, | ||
Column, | ||
DateTime, | ||
Integer, | ||
) | ||
|
||
from galaxy.model.custom_types import TrimmedString | ||
from galaxy.model.migrations.util import ( | ||
create_table, | ||
drop_table, | ||
) | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "64ee692df15b" | ||
down_revision = "75348cfb3715" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
user_credentials_table = "user_credentials" | ||
user_credentials_group_table = "user_credentials_group" | ||
variable_table = "variable" | ||
secret_table = "secret" | ||
|
||
|
||
def upgrade(): | ||
create_table( | ||
user_credentials_table, | ||
Column("id", Integer, primary_key=True), | ||
Column("user_id", Integer, index=True), | ||
Column("reference", TrimmedString(255)), | ||
Column("source_type", TrimmedString(255)), | ||
Column("source_id", TrimmedString(255)), | ||
Column("current_group_id", Integer, index=True), | ||
Column("create_time", DateTime), | ||
Column("update_time", DateTime), | ||
) | ||
create_table( | ||
user_credentials_group_table, | ||
Column("id", Integer, primary_key=True), | ||
Column("name", TrimmedString(255)), | ||
Column("user_credentials_id", Integer, index=True), | ||
Column("create_time", DateTime), | ||
Column("update_time", DateTime), | ||
) | ||
create_table( | ||
variable_table, | ||
Column("id", Integer, primary_key=True), | ||
Column("name", 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(variable_table) | ||
drop_table(secret_table) | ||
drop_table(user_credentials_group_table) | ||
drop_table(user_credentials_table) |