Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Package registry
Container registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
videoag
backend
Commits
3b63d3c7
Commit
3b63d3c7
authored
3 months ago
by
Simon Künzel
Browse files
Options
Downloads
Patches
Plain Diff
Fix migration
parent
d256a280
No related branches found
No related tags found
No related merge requests found
Pipeline
#7536
passed
3 months ago
Stage: build
Stage: run
Pipeline: backend
#7537
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
api/migration.sql
+18
-1
18 additions, 1 deletion
api/migration.sql
with
18 additions
and
1 deletion
api/migration.sql
+
18
−
1
View file @
3b63d3c7
UPDATE
data
.
job
SET
cause_job_id
=
NULL
,
cause_user_id
=
NULL
WHERE
id
>=
0
;
DELETE
FROM
lecture_daily_watch_stats
;
DELETE
FROM
lecture_watch_stats
;
DELETE
FROM
publish_medium_segment_watch_stats
;
DELETE
FROM
publish_medium_watch_client_stats
;
DELETE
FROM
publish_medium_watch_log_entry
;
DELETE
FROM
publish_medium_watcher
;
DELETE
FROM
data
.
featured
WHERE
id
>=
0
;
DELETE
FROM
data
.
announcement
WHERE
id
>=
0
;
DELETE
FROM
data
.
changelog_entry
WHERE
id
>=
0
;
...
...
@@ -214,7 +221,17 @@ INSERT INTO data.lecture (id, deleted, visible, course_id, title, speaker, locat
disable_automatic_media_process_scheduler
)
SELECT
id
,
deleted
,
visible
,
course_id
,
title
,
speaker
,
place
,
"time"
,
duration
,
comment
,
norecording
,
live
,
internal
,
(
SELECT
MIN
(
time_created
)
FROM
old_data
.
videos_data
AS
vid
WHERE
vid
.
lecture_id
=
old_lec
.
id
AND
vid
.
visible
AND
NOT
vid
.
deleted
),
-- publish_time
(
SELECT
MIN
(
CASE
-- There are some "0" timestamps
WHEN
time_created
>
'1900-01-01 00:00:00'
::
timestamp
THEN
time_created
ELSE
file_modified
END
)
FROM
old_data
.
videos_data
AS
vid
WHERE
vid
.
lecture_id
=
old_lec
.
id
AND
vid
.
visible
AND
NOT
vid
.
deleted
),
-- publish_time
'inherit'
,
False
,
False
,
NULL
,
NULL
,
-- view_perm (filled below)
False
-- disable_automatic_media_process_scheduler (Already disabled by course)
FROM
old_data
.
lectures_data
AS
old_lec
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment