From ea5542fb7cd143408353fcba7c24804249fa6b00 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Thu, 27 Apr 2023 15:10:08 -0400 Subject: [PATCH] Migration for user defined object stores. --- ...3c93d66a_add_user_defined_object_stores.py | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 lib/galaxy/model/migrations/alembic/versions_gxy/c14a3c93d66a_add_user_defined_object_stores.py diff --git a/lib/galaxy/model/migrations/alembic/versions_gxy/c14a3c93d66a_add_user_defined_object_stores.py b/lib/galaxy/model/migrations/alembic/versions_gxy/c14a3c93d66a_add_user_defined_object_stores.py new file mode 100644 index 000000000000..57d0c12de118 --- /dev/null +++ b/lib/galaxy/model/migrations/alembic/versions_gxy/c14a3c93d66a_add_user_defined_object_stores.py @@ -0,0 +1,49 @@ +"""add user defined object stores + +Revision ID: c14a3c93d66a +Revises: ddbdbc40bdc1 +Create Date: 2023-04-01 17:25:37.553039 + +""" +from alembic import op +from sqlalchemy import ( + Column, + DateTime, + ForeignKey, + Integer, + String, + Text, +) + +from galaxy.model.custom_types import JSONType + +# revision identifiers, used by Alembic. +revision = "c14a3c93d66a" +down_revision = "ddbdbc40bdc1" +branch_labels = None +depends_on = None + + +# database object names used in this revision +table_name = "user_object_store" + + +def upgrade(): + op.create_table( + table_name, + Column("id", Integer, primary_key=True), + Column("user_id", Integer, ForeignKey("galaxy_user.id"), nullable=False, index=True), + Column("name", String(255), index=True), + Column("description", Text, index=True), + Column("create_time", DateTime), + Column("update_time", DateTime), + Column("object_store_template_id", String(255), index=True), + Column("object_store_template_version", Integer, index=True), + Column("object_store_template_definition", JSONType), + Column("object_store_template_variables", JSONType), + Column("object_store_template_secrets", JSONType), + ) + + +def downgrade(): + op.drop_table(table_name)