File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
openbas-api/src/main/java/io/openbas/migration Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change
1
+ package io .openbas .migration ;
2
+
3
+ import java .sql .Connection ;
4
+ import java .sql .Statement ;
5
+ import org .flywaydb .core .api .migration .BaseJavaMigration ;
6
+ import org .flywaydb .core .api .migration .Context ;
7
+ import org .springframework .stereotype .Component ;
8
+
9
+ @ Component
10
+ public class V4_12__Update_Role_table extends BaseJavaMigration {
11
+
12
+ @ Override
13
+ public void migrate (Context context ) throws Exception {
14
+ Connection connection = context .getConnection ();
15
+ Statement stmt = connection .createStatement ();
16
+ stmt .execute (
17
+ """
18
+ ALTER TABLE roles
19
+ ADD COLUMN role_created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
20
+ ADD COLUMN role_updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW();
21
+ """ );
22
+ }
23
+ }
You can’t perform that action at this time.
0 commit comments