Skip to content

Commit

Permalink
Merge pull request #9 from shortintern2020-A-labyrinth/createTable
Browse files Browse the repository at this point in the history
Create table
  • Loading branch information
Highmt authored Aug 24, 2020
2 parents 63500a2 + 3e5fd22 commit aee0b17
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 16 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
./target/*
target/
*.iml
.idea/
demo.iml
*.class
22 changes: 11 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
version: '3'

services:
db:
image: postgres:latest
container_name: emolog_db
volumes:
- ./docker/pg:/docker-entrypoint-initdb.d
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test_db
ports:
- '5432:5432'
db:
image: postgres:latest
container_name: emolog_db
volumes:
- ./docker/pg:/docker-entrypoint-initdb.d
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test_db
ports:
- '5432:5432'
49 changes: 45 additions & 4 deletions docker/pg/1-createTable.sql
Original file line number Diff line number Diff line change
@@ -1,16 +1,57 @@
create table users (
id serial primary key,
name varchar not null,
age integer not null
name varchar(30) not null,
mail varchar(50) not null,
filterlevel smallint
);

create table friend (
id serial primary key,
userid INTEGER not null,
friendid INTEGER not null,
name varchar(30) not null,
latestemolog varchar(30)
);

create table emolog (
id serial primary key,
userid INTEGER not null,
friendid INTEGER not null,
create_at timestamp,
contents varchar(30)
);

create table talk (
id serial primary key,
userid INTEGER not null,
friendid INTEGER not null,
contents varchar(30)
create_at timestamp,
);

create table requestfriend (
id serial primary key,
userid INTEGER not null,
requestfriendid INTEGER not null,
contents varchar(30)
create_at timestamp,
);

create table emojicode (
keyword serial primary key,
emoji_code
emoji_code
);


insert into users(name, mail, filterlevel) values
('ichigo.chocomint', '[email protected]', 1),
('banana.chocomint', '[email protected]', 2),
('pinapple.chocomint', '[email protected]', 3)
;


insert into users(name, age) values
('ichigo.chocomint', 99),
('banana.chocomint', 98),
('pinapple.chocomint', 97)
;
;
Binary file not shown.
Binary file removed target/classes/com/example/demo/entity/View.class
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit aee0b17

Please sign in to comment.