-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathcreate database.sql
More file actions
33 lines (27 loc) · 1.02 KB
/
create database.sql
File metadata and controls
33 lines (27 loc) · 1.02 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
CREATE SCHEMA `spanners` ;
USE `spanners`;
delimiter $$
CREATE TABLE `spanner` (
`id` int(11) NOT NULL auto_increment,
`name` varchar(255) default NULL,
`size` int(11) default NULL,
`owner` varchar(255) default NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1$$
/*
* Spring Security users / authorities schema.
* Adapted from https://docs.spring.io/spring-security/site/docs/4.0.1.RELEASE/reference/html/appendix-schema.html
*/
create table `user` (
username varchar(50) not null primary key,
password varchar(60) not null,
enabled boolean not null
) engine = InnoDb DEFAULT CHARSET=latin1$$
create table `authority` (
username varchar(50) not null,
authority varchar(50) not null,
foreign key (username) references `user` (username),
unique index authorities_idx_1 (username, authority)
) engine = InnoDb DEFAULT CHARSET=latin1$$
GRANT ALL PRIVILEGES ON spanners.* TO "spanners"@"localhost" IDENTIFIED BY "password";