Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
0455b806
Unverified
Commit
0455b806
authored
Apr 27, 2024
by
Timothy Jaeryang Baek
Committed by
GitHub
Apr 27, 2024
Browse files
Merge pull request #1809 from open-webui/dev
fix
parents
97609970
71a75bcc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
backend/apps/web/internal/migrations/007_add_user_last_active_at.py
...ps/web/internal/migrations/007_add_user_last_active_at.py
+2
-2
No files found.
backend/apps/web/internal/migrations/007_add_user_last_active_at.py
View file @
0455b806
...
...
@@ -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
...
...
@@ -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"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment