-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathsetup.sql
More file actions
52 lines (39 loc) · 1.19 KB
/
setup.sql
File metadata and controls
52 lines (39 loc) · 1.19 KB
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
43
44
45
46
47
48
49
50
51
52
DROP DATABASE IF EXISTS tenant_ghi;
DROP DATABASE IF EXISTS tenant_def;
DROP DATABASE IF EXISTS tenant_abc;
DROP DATABASE IF EXISTS tenants_db;
create database tenants_db;
create database tenant_abc;
create database tenant_def;
create database tenant_ghi;
use tenants_db;
create table tenant (
id char(3) not null,
url varchar(255) not null,
username varchar(255) not null,
pwd varchar(255),
constraint PK_tenant primary key (id)
);
insert into tenant values ('abc', 'jdbc:mysql://localhost:3306/tenant_abc', 'root', NULL);
insert into tenant values ('def', 'jdbc:mysql://localhost:3306/tenant_def', 'root', NULL);
use tenant_abc;
create table location (
id varchar(3) not null,
name varchar(255) not null,
constraint PK_location primary key (id)
);
insert into location values ('123', 'Location ABC-123');
use tenant_def;
create table location (
id varchar(3) not null,
name varchar(255) not null,
constraint PK_location primary key (id)
);
insert into location values ('345', 'Location DEF-345');
use tenant_ghi;
create table location (
id varchar(3) not null,
name varchar(255) not null,
constraint PK_location primary key (id)
);
insert into location values ('678', 'Location GHI-678');