Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tjbck committed Apr 28, 2024
1 parent 48ed701 commit 71a75bc
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def migrate(migrator: Migrator, database: pw.Database, *, fake=False):

# Populate the new fields from an existing 'timestamp' field
migrator.sql(
"UPDATE user SET created_at = timestamp, updated_at = timestamp, last_active_at = timestamp WHERE timestamp IS NOT NULL"
'UPDATE "user" SET created_at = timestamp, updated_at = timestamp, last_active_at = timestamp WHERE timestamp IS NOT NULL'
)

# Now that the data has been copied, remove the original 'timestamp' field
Expand All @@ -70,7 +70,7 @@ def rollback(migrator: Migrator, database: pw.Database, *, fake=False):

# Copy the earliest created_at date back into the new timestamp field
# This assumes created_at was originally a copy of timestamp
migrator.sql("UPDATE user SET timestamp = created_at")
migrator.sql('UPDATE "user" SET timestamp = created_at')

# Remove the created_at and updated_at fields
migrator.remove_fields("user", "created_at", "updated_at", "last_active_at")
Expand Down

0 comments on commit 71a75bc

Please sign in to comment.