From 00877910d7480fc565d1d0452b1cd685382b5065 Mon Sep 17 00:00:00 2001 From: Yuta Takayama Date: Mon, 24 Aug 2020 14:13:01 +0900 Subject: [PATCH 1/2] =?UTF-8?q?DDL=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- docker-compose.yml | 22 ++++++++-------- docker/pg/1-createTable.sql | 51 ++++++++++++++++++++++++++++++++----- 3 files changed, 57 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index af50845..bfde584 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -./target/* \ No newline at end of file +./target/* +*.iml \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 8676242..556ccd1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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' \ No newline at end of file + 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' \ No newline at end of file diff --git a/docker/pg/1-createTable.sql b/docker/pg/1-createTable.sql index f814940..21f35da 100644 --- a/docker/pg/1-createTable.sql +++ b/docker/pg/1-createTable.sql @@ -1,11 +1,48 @@ 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 ); -insert into users(name, age) values - ('ichigo.chocomint', 99), - ('banana.chocomint', 98), - ('pinapple.chocomint', 97) -; \ No newline at end of file +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, +); + + + + +insert into users(name, mail, filterlevel) values + ('ichigo.chocomint', 'hoge@hoge.com', 1), + ('banana.chocomint', 'hogehoge@hoge.com', 2), + ('pinapple.chocomint', 'hogehogehoge@hoge.com', 3) +; + From ce25ab9c4a2aa302735e40f4a5d0ee04c3761eab Mon Sep 17 00:00:00 2001 From: Yuta Takayama Date: Mon, 24 Aug 2020 14:19:12 +0900 Subject: [PATCH 2/2] =?UTF-8?q?gitignore=20=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index bfde584..018b872 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ -./target/* -*.iml \ No newline at end of file +target/ +*.iml +.idea/ +demo.iml +*.class \ No newline at end of file