Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
rabbitmq_agents
Manage
Activity
Members
Labels
Plan
Issues
16
Issue boards
Milestones
Wiki
Code
Merge requests
10
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rc
rabbitmq_agents
Commits
97b993d6
Commit
97b993d6
authored
10 months ago
by
Bo-Chun Chen
Browse files
Options
Downloads
Patches
Plain Diff
Add migration script to rename column
parent
a812e75f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!152
Fix account cli
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
migrations/20240729_groups_rename_column.sql
+27
-0
27 additions, 0 deletions
migrations/20240729_groups_rename_column.sql
with
27 additions
and
0 deletions
migrations/20240729_groups_rename_column.sql
0 → 100644
+
27
−
0
View file @
97b993d6
BEGIN
TRANSACTION
;
-- Create new table with updated_by column
CREATE
TABLE
groups_temp
(
id
INTEGER
PRIMARY
KEY
,
user
TEXT
,
"group"
TEXT
,
operation
INTEGER
,
date
DATETIME
,
host
TEXT
,
updated_by
TEXT
,
interface
TEXT
);
-- Copy all entries from old table
INSERT
INTO
groups_temp
(
user
,
"group"
,
operation
,
date
,
host
,
updated_by
,
interface
)
SELECT
user
,
"group"
,
operation
,
date
,
host
,
executed_by
,
interface
FROM
groups
;
-- Drop old table
DROP
TABLE
groups
;
-- Rename new table
ALTER
TABLE
groups_temp
RENAME
TO
groups
;
COMMIT
;
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