Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create table #9

Merged
merged 3 commits into from
Aug 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.