Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
b0119f32
Commit
b0119f32
authored
Feb 01, 2025
by
johnnyjoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: tweak migration scripts
parent
5e770dda
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
29 additions
and
32 deletions
+29
-32
version.go
server/version/version.go
+1
-1
00__memo.sql
store/migration/mysql/0.24/00__memo.sql
+1
-10
01__memo_pinned.sql
store/migration/mysql/0.24/01__memo_pinned.sql
+8
-0
00__memo.sql
store/migration/postgres/0.24/00__memo.sql
+1
-10
01__memo_pinned.sql
store/migration/postgres/0.24/01__memo_pinned.sql
+8
-0
00__memo.sql
store/migration/sqlite/0.24/00__memo.sql
+1
-10
01__memo_pinned.sql
store/migration/sqlite/0.24/01__memo_pinned.sql
+8
-0
migrator_test.go
test/store/migrator_test.go
+1
-1
No files found.
server/version/version.go
View file @
b0119f32
...
@@ -9,7 +9,7 @@ import (
...
@@ -9,7 +9,7 @@ import (
// Version is the service current released version.
// Version is the service current released version.
// Semantic versioning: https://semver.org/
// Semantic versioning: https://semver.org/
var
Version
=
"0.2
3.1
"
var
Version
=
"0.2
4.0
"
// DevVersion is the service current development version.
// DevVersion is the service current development version.
var
DevVersion
=
"0.24.0"
var
DevVersion
=
"0.24.0"
...
...
store/migration/mysql/0.24/00__memo.sql
View file @
b0119f32
-- Drop deprecated tags column.
-- Drop deprecated tags column.
ALTER
TABLE
`memo`
DROP
COLUMN
`tags`
;
ALTER
TABLE
`memo`
DROP
COLUMN
`tags`
;
-- Add pinned column.
ALTER
TABLE
`memo`
ADD
COLUMN
`pinned`
BOOLEAN
NOT
NULL
DEFAULT
FALSE
;
-- Update pinned column from memo_organizer.
UPDATE
`memo`
SET
`pinned`
=
TRUE
FROM
`memo_organizer`
WHERE
`memo`
.
`id`
=
`memo_organizer`
.
`memo_id`
AND
`memo_organizer`
.
`pinned`
=
1
;
\ No newline at end of file
store/migration/mysql/0.24/01__memo_pinned.sql
0 → 100644
View file @
b0119f32
-- Add pinned column.
ALTER
TABLE
`memo`
ADD
COLUMN
`pinned`
BOOLEAN
NOT
NULL
DEFAULT
FALSE
;
-- Update pinned column from memo_organizer.
UPDATE
`memo`
SET
`pinned`
=
TRUE
FROM
`memo_organizer`
WHERE
`memo`
.
`id`
=
`memo_organizer`
.
`memo_id`
AND
`memo_organizer`
.
`pinned`
=
1
;
\ No newline at end of file
store/migration/postgres/0.24/00__memo.sql
View file @
b0119f32
-- Drop deprecated tags column.
-- Drop deprecated tags column.
ALTER
TABLE
memo
DROP
COLUMN
tags
;
ALTER
TABLE
memo
DROP
COLUMN
tags
;
-- Add pinned column.
ALTER
TABLE
memo
ADD
COLUMN
pinned
BOOLEAN
NOT
NULL
DEFAULT
FALSE
;
-- Update pinned column from memo_organizer.
UPDATE
memo
SET
pinned
=
TRUE
FROM
memo_organizer
WHERE
memo
.
id
=
memo_organizer
.
memo_id
AND
memo_organizer
.
pinned
=
1
;
\ No newline at end of file
store/migration/postgres/0.24/01__memo_pinned.sql
0 → 100644
View file @
b0119f32
-- Add pinned column.
ALTER
TABLE
memo
ADD
COLUMN
pinned
BOOLEAN
NOT
NULL
DEFAULT
FALSE
;
-- Update pinned column from memo_organizer.
UPDATE
memo
SET
pinned
=
TRUE
FROM
memo_organizer
WHERE
memo
.
id
=
memo_organizer
.
memo_id
AND
memo_organizer
.
pinned
=
1
;
\ No newline at end of file
store/migration/sqlite/0.24/00__memo.sql
View file @
b0119f32
...
@@ -5,12 +5,3 @@ ALTER TABLE memo DROP COLUMN tags;
...
@@ -5,12 +5,3 @@ ALTER TABLE memo DROP COLUMN tags;
DROP
INDEX
IF
EXISTS
idx_memo_tags
;
DROP
INDEX
IF
EXISTS
idx_memo_tags
;
DROP
INDEX
IF
EXISTS
idx_memo_content
;
DROP
INDEX
IF
EXISTS
idx_memo_content
;
DROP
INDEX
IF
EXISTS
idx_memo_visibility
;
DROP
INDEX
IF
EXISTS
idx_memo_visibility
;
-- Add pinned column.
ALTER
TABLE
memo
ADD
COLUMN
pinned
INTEGER
NOT
NULL
CHECK
(
pinned
IN
(
0
,
1
))
DEFAULT
0
;
-- Update pinned column from memo_organizer.
UPDATE
memo
SET
pinned
=
1
FROM
memo_organizer
WHERE
memo
.
id
=
memo_organizer
.
memo_id
AND
memo_organizer
.
pinned
=
1
;
\ No newline at end of file
store/migration/sqlite/0.24/01__memo_pinned.sql
0 → 100644
View file @
b0119f32
-- Add pinned column.
ALTER
TABLE
memo
ADD
COLUMN
pinned
INTEGER
NOT
NULL
CHECK
(
pinned
IN
(
0
,
1
))
DEFAULT
0
;
-- Update pinned column from memo_organizer.
UPDATE
memo
SET
pinned
=
1
FROM
memo_organizer
WHERE
memo
.
id
=
memo_organizer
.
memo_id
AND
memo_organizer
.
pinned
=
1
;
\ No newline at end of file
test/store/migrator_test.go
View file @
b0119f32
...
@@ -13,5 +13,5 @@ func TestGetCurrentSchemaVersion(t *testing.T) {
...
@@ -13,5 +13,5 @@ func TestGetCurrentSchemaVersion(t *testing.T) {
currentSchemaVersion
,
err
:=
ts
.
GetCurrentSchemaVersion
()
currentSchemaVersion
,
err
:=
ts
.
GetCurrentSchemaVersion
()
require
.
NoError
(
t
,
err
)
require
.
NoError
(
t
,
err
)
require
.
Equal
(
t
,
"0.2
3.1
"
,
currentSchemaVersion
)
require
.
Equal
(
t
,
"0.2
4.2
"
,
currentSchemaVersion
)
}
}
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