You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: internal/database/schema/system_tables.go
+5-9Lines changed: 5 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,6 @@
1
1
package schema
2
2
3
-
import (
4
-
"fmt"
5
-
6
-
"github.com/Notifuse/notifuse/config"
7
-
)
3
+
// Schema definitions - no external imports needed
8
4
9
5
// TableDefinitions contains all the SQL statements to create the database tables
10
6
// Don't put REFERENCES and don't put CHECK constraints in the CREATE TABLE statements
@@ -37,6 +33,7 @@ var TableDefinitions = []string{
37
33
user_id UUID NOT NULL,
38
34
workspace_id VARCHAR(20) NOT NULL,
39
35
role VARCHAR(20) NOT NULL,
36
+
permissions JSONB DEFAULT '{}'::jsonb,
40
37
created_at TIMESTAMP NOT NULL,
41
38
updated_at TIMESTAMP NOT NULL,
42
39
PRIMARY KEY (user_id, workspace_id)
@@ -114,11 +111,9 @@ var MigrationStatements = []string{
114
111
)`,
115
112
}
116
113
117
-
// GetMigrationStatements returns migration statements with the current version
114
+
// GetMigrationStatements returns migration statements for database schema setup
118
115
funcGetMigrationStatements() []string {
119
-
versionInsert:=fmt.Sprintf(`INSERT INTO settings (key, value) VALUES ('db_version', '%s') ON CONFLICT (key) DO UPDATE SET value = '%s', updated_at = CURRENT_TIMESTAMP`, config.VERSION, config.VERSION)
120
-
121
-
returnappend(MigrationStatements, versionInsert)
116
+
returnMigrationStatements
122
117
}
123
118
124
119
// TableNames returns a list of all table names in creation order
0 commit comments