-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
481e6a2
commit 43fce26
Showing
7 changed files
with
176 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
src/main/resources/db/changelog/changes/03-create-users-table.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
databaseChangeLog: | ||
- changeSet: | ||
id: create-users-table | ||
author: Ros | ||
changes: | ||
- createTable: | ||
tableName: users | ||
columns: | ||
- column: | ||
name: id | ||
type: bigint | ||
autoIncrement: true | ||
constraints: | ||
primaryKey: true | ||
nullable: false | ||
- column: | ||
name: email | ||
type: varchar(255) | ||
constraints: | ||
nullable: false | ||
unique: true | ||
- column: | ||
name: password | ||
type: varchar(255) | ||
constraints: | ||
nullable: false | ||
- column: | ||
name: first_name | ||
type: varchar(255) | ||
constraints: | ||
nullable: false | ||
- column: | ||
name: last_name | ||
type: varchar(255) | ||
constraints: | ||
nullable: false | ||
- column: | ||
name: shipping_address | ||
type: varchar(255) | ||
- column: | ||
name: is_deleted | ||
type: boolean | ||
constraints: | ||
nullable: false | ||
defaultValue: "false" |
29 changes: 29 additions & 0 deletions
29
src/main/resources/db/changelog/changes/04-fill-users-table-with-data.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
databaseChangeLog: | ||
- changeSet: | ||
id: fill-users-table-by-data | ||
author: Ros | ||
changes: | ||
- insert: | ||
tableName: users | ||
columns: | ||
- column: {name: "email", value: "[email protected]"} | ||
- column: {name: "password", value: "$%^&*()DFGHJKL>dfghjkl$%^&*()DFGHJKL>dfghjkl"} # "111"} | ||
- column: {name: "first_name", value: "John"} | ||
- column: {name: "last_name", value: "alicovich"} | ||
- column: {name: "shipping_address", value: "provulok bobd, cpo55"} | ||
- insert: | ||
tableName: users | ||
columns: | ||
- column: {name: "email", value: "[email protected]"} | ||
- column: {name: "password", value: "DFGHJKL:#$%^&*()34567890SDFGHJKLdfghjk0SDFGHJKLdfghjk"} # "222"} | ||
- column: {name: "first_name", value: "alice"} | ||
- column: {name: "last_name", value: "bobovich"} | ||
- column: {name: "shipping_address", value: "provulok alice, jkE33"} | ||
- insert: | ||
tableName: users | ||
columns: | ||
- column: {name: "email", value: "[email protected]"} | ||
- column: {name: "password", value: "lkjftFHHJJNBVDD$%^*IHBHGCGF3"} # "333"} | ||
- column: {name: "first_name", value: "bob"} | ||
- column: {name: "last_name", value: "alison"} | ||
- column: {name: "shipping_address", value: "provulok boba, sH12"} |
27 changes: 27 additions & 0 deletions
27
src/main/resources/db/changelog/changes/05-create-roles-table.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
databaseChangeLog: | ||
- changeSet: | ||
id: create-roles-table | ||
author: Ros | ||
changes: | ||
- createTable: | ||
tableName: roles | ||
columns: | ||
- column: | ||
name: id | ||
type: bigint | ||
autoIncrement: true | ||
constraints: | ||
primaryKey: true | ||
nullable: false | ||
- column: | ||
name: name | ||
type: varchar(255) | ||
constraints: | ||
nullable: false | ||
unique: true | ||
- column: | ||
name: is_deleted | ||
type: boolean | ||
constraints: | ||
nullable: false | ||
defaultValue: "false" |
14 changes: 14 additions & 0 deletions
14
src/main/resources/db/changelog/changes/06-fill-roles-table-by-data.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
databaseChangeLog: | ||
- changeSet: | ||
id: fill-roles-table-by-data | ||
author: Ros | ||
changes: | ||
- insert: | ||
tableName: roles | ||
columns: | ||
- column: {name: "name", value: "ADMIN"} | ||
- insert: | ||
tableName: roles | ||
columns: | ||
- column: {name: "name", value: "USER"} | ||
|
26 changes: 26 additions & 0 deletions
26
src/main/resources/db/changelog/changes/07-create-users-roles-table.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
databaseChangeLog: | ||
- changeSet: | ||
id: create-users-roles-table | ||
author: Ros | ||
changes: | ||
- createTable: | ||
tableName: users_roles | ||
columns: | ||
- column: | ||
name: user_id | ||
type: bigint | ||
constraints: | ||
foreignKeyName: fk_users_roles_users | ||
referencedTableName: users | ||
referencedColumnNames: id | ||
nullable: false | ||
primaryKey: true | ||
- column: | ||
name: role_id | ||
type: bigint | ||
constraints: | ||
foreignKeyName: fk_users_roles_roles | ||
referencedTableName: roles | ||
referencedColumnNames: id | ||
nullable: false | ||
primaryKey: true |
20 changes: 20 additions & 0 deletions
20
src/main/resources/db/changelog/changes/08-fill-users-roles-table-with-data.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
databaseChangeLog: | ||
- changeSet: | ||
id: fill-users-roles-table-by-data | ||
author: Ros | ||
changes: | ||
- insert: | ||
tableName: users_roles | ||
columns: | ||
- column: {name: "user_id", value: "1"} | ||
- column: {name: "role_id", value: "1"} | ||
- insert: | ||
tableName: users_roles | ||
columns: | ||
- column: {name: "user_id", value: "2"} | ||
- column: {name: "role_id", value: "2"} | ||
- insert: | ||
tableName: users_roles | ||
columns: | ||
- column: {name: "user_id", value: "3"} | ||
- column: {name: "role_id", value: "2"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters