-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.jooq
42 lines (31 loc) · 2 KB
/
README.jooq
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
TapisV3 Notifications JOOQ Notes
=======================================
-------------------------------------
Schema updates
-------------------------------------
Whenever the DB schema is updated it will be necessary to regenerate the jooq java code.
To update the schema and re-create the jooq code:
1. Create the flyway migration sql files under tapis-notificationslib/src/main/resources/db/migration
2. Make changes in Dao implementation under tapis-notificationslib/src/main/java/edu/utexas/tacc/tapis/notifications/dao.
Be sure to update for tables and columns that have been renamed or removed.
Or proceed with steps 3,4,5 and see what compile failures happen, then make updates.
3. Make sure local DB is up and tapis-notificationslib/pom.xml has correct properties for db.url, db.username and db.password
If using a new postgres the following commands should be used to create the initial DB:
CREATE DATABASE tapisntfdb ENCODING="UTF8" LC_COLLATE="en_US.utf8" LC_CTYPE="en_US.utf8"
CREATE ROLE tapis_ntf WITH LOGIN;
ALTER USER tapis_ntf WITH ENCRYPTED PASSWORD '<password>';
Where <password> is the password that has been placed in tapis-notificationslib/pom.xml (search for property db.password)
4. Use sql in lib/src/main/resources/sql/reset_db.sql to reset the schema
DROP SCHEMA IF EXISTS tapis_ntf CASCADE;
CREATE SCHEMA IF NOT EXISTS tapis_ntf AUTHORIZATION tapis_ntf;
ALTER ROLE tapis_ntf SET search_path = 'tapis_ntf';
SET search_path TO tapis_ntf;
5. Run the maven profile to re-create the schema and generate/update the jooq source code:
a. cd tapis-notificationslib
b. mvn clean install -Pdb-update
6. If necessary fix any compile errors (such as in the Dao)
7. Run a top level mvn clean install.
8. Using "git status" you should be able to see the updates to the jooq source code.
9. Make other updates as needed for Dao and service layers. For example, if columns added this is the time
to start adding the new model attributes to the code.
10. Commit the updates.