diff options
| author | lucashemi <lucasxberger@gmail.com> | 2023-02-08 14:57:43 -0300 |
|---|---|---|
| committer | lucashemi <lucasxberger@gmail.com> | 2023-02-08 14:57:43 -0300 |
| commit | 514f2e7194a875cfc53d7e1bccd922db2bbb3f3f (patch) | |
| tree | 6b62dada02b9d02e624c40b7f3d4704537cbcb80 /api/src/main/resources/db/migration | |
readme
Diffstat (limited to 'api/src/main/resources/db/migration')
6 files changed, 45 insertions, 0 deletions
diff --git a/api/src/main/resources/db/migration/V1__create-table-doctors.sql b/api/src/main/resources/db/migration/V1__create-table-doctors.sql new file mode 100644 index 0000000..e4afbe8 --- /dev/null +++ b/api/src/main/resources/db/migration/V1__create-table-doctors.sql @@ -0,0 +1,15 @@ +create table doctors( + + id bigint not null auto_increment, + name varchar(100) not null, + email varchar(100) not null unique, + specialty varchar(100) not null, + address_line1 varchar(100) not null, + address_line2 varchar(100) not null, + postal_code varchar(9) not null, + state varchar(100) not null, + city varchar(100) not null, + + primary key(id) + +);
\ No newline at end of file diff --git a/api/src/main/resources/db/migration/V2__alter-table-doctors-column-telephone.sql b/api/src/main/resources/db/migration/V2__alter-table-doctors-column-telephone.sql new file mode 100644 index 0000000..3955b36 --- /dev/null +++ b/api/src/main/resources/db/migration/V2__alter-table-doctors-column-telephone.sql @@ -0,0 +1 @@ +alter table doctors add phone varchar(20) not null;
\ No newline at end of file diff --git a/api/src/main/resources/db/migration/V3__create-table-patients.sql b/api/src/main/resources/db/migration/V3__create-table-patients.sql new file mode 100644 index 0000000..a0cc01c --- /dev/null +++ b/api/src/main/resources/db/migration/V3__create-table-patients.sql @@ -0,0 +1,16 @@ +create table patients( + + id bigint not null auto_increment, + name varchar(100) not null, + email varchar(100) not null unique, + phone varchar(20) not null, + ssn varchar(11) not null unique, + address_line1 varchar(100) not null, + address_line2 varchar(100) not null, + postal_code varchar(9) not null, + state char(100) not null, + city varchar(100) not null, + + primary key(id) + +);
\ No newline at end of file diff --git a/api/src/main/resources/db/migration/V4__alter-table-doctors-add-column-active.sql b/api/src/main/resources/db/migration/V4__alter-table-doctors-add-column-active.sql new file mode 100644 index 0000000..bdbfa76 --- /dev/null +++ b/api/src/main/resources/db/migration/V4__alter-table-doctors-add-column-active.sql @@ -0,0 +1,2 @@ +alter table doctors add active tinyint; +update doctors set active = 1;
\ No newline at end of file diff --git a/api/src/main/resources/db/migration/V5__alter-table-patients-add-column-active.sql b/api/src/main/resources/db/migration/V5__alter-table-patients-add-column-active.sql new file mode 100644 index 0000000..c6432e6 --- /dev/null +++ b/api/src/main/resources/db/migration/V5__alter-table-patients-add-column-active.sql @@ -0,0 +1,2 @@ +alter table patients add active tinyint; +update patients set active = 1;
\ No newline at end of file diff --git a/api/src/main/resources/db/migration/V6__create-table-users.sql b/api/src/main/resources/db/migration/V6__create-table-users.sql new file mode 100644 index 0000000..07d3d79 --- /dev/null +++ b/api/src/main/resources/db/migration/V6__create-table-users.sql @@ -0,0 +1,9 @@ +create table users +( + id bigint not null auto_increment, + login varchar(100) not null, + password varchar(255) not null, + + primary key (id) + +);
\ No newline at end of file |
