Skip to content

Commit 3857106

Browse files
heditarcamrrx
authored andcommitted
Issue/375 add role created/updated date (#375)
1 parent b4700fd commit 3857106

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
}

0 commit comments

Comments
 (0)