fix settings migration file
This commit is contained in:
@@ -31,10 +31,10 @@ def upgrade():
|
|||||||
# Check if we need to insert default data
|
# Check if we need to insert default data
|
||||||
result = conn.execute(text("SELECT COUNT(*) FROM docupulse_settings")).scalar()
|
result = conn.execute(text("SELECT COUNT(*) FROM docupulse_settings")).scalar()
|
||||||
if result == 0:
|
if result == 0:
|
||||||
conn.execute("""
|
conn.execute(text("""
|
||||||
INSERT INTO docupulse_settings (id, max_rooms, max_conversations, max_storage, updated_at)
|
INSERT INTO docupulse_settings (id, max_rooms, max_conversations, max_storage, updated_at)
|
||||||
VALUES (1, 10, 10, 10737418240, CURRENT_TIMESTAMP)
|
VALUES (1, 10, 10, 10737418240, CURRENT_TIMESTAMP)
|
||||||
""")
|
"""))
|
||||||
else:
|
else:
|
||||||
# Create new table
|
# Create new table
|
||||||
op.create_table('docupulse_settings',
|
op.create_table('docupulse_settings',
|
||||||
@@ -47,10 +47,10 @@ def upgrade():
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Insert default settings
|
# Insert default settings
|
||||||
op.execute("""
|
op.execute(text("""
|
||||||
INSERT INTO docupulse_settings (id, max_rooms, max_conversations, max_storage, updated_at)
|
INSERT INTO docupulse_settings (id, max_rooms, max_conversations, max_storage, updated_at)
|
||||||
VALUES (1, 10, 10, 10737418240, CURRENT_TIMESTAMP)
|
VALUES (1, 10, 10, 10737418240, CURRENT_TIMESTAMP)
|
||||||
""")
|
"""))
|
||||||
|
|
||||||
def downgrade():
|
def downgrade():
|
||||||
op.drop_table('docupulse_settings')
|
op.drop_table('docupulse_settings')
|
||||||
Binary file not shown.
Reference in New Issue
Block a user