From 1e9c60478cfdbe0fc80c96a48adba6cb91c4190f Mon Sep 17 00:00:00 2001 From: ccw <1163730411@qq.com> Date: Tue, 4 Jul 2017 17:55:18 +0800 Subject: [PATCH 1/3] mysql-connector --- server/pom.xml | 7 +++++++ server/src/main/resources/application.properties | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/server/pom.xml b/server/pom.xml index f28c4c5..9550d65 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -69,6 +69,13 @@ org.springframework.boot spring-boot-starter-undertow + + + mysql + mysql-connector-java + 5.1.41 + + - mysql - mysql-connector-java - 5.1.41 + postgresql + postgresql + 9.4.1208-jdbc42-atlassian-hosted - + - - - diff --git a/server/src/main/resources/application.properties b/server/src/main/resources/application.properties index f4c3268..17ec148 100644 --- a/server/src/main/resources/application.properties +++ b/server/src/main/resources/application.properties @@ -12,6 +12,7 @@ image.file.upload.dir=static/upload/ spring.thymeleaf.cache=false spring.template.cache=false -spring.datasource.url=jdbc:mysql://localhost/yidongyi?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true -spring.datasource.username=root -spring.datasource.password=123456 \ No newline at end of file +spring.datasource.url = jdbc:postgresql://localhost:5432/yidongyi +spring.datasource.username=postgres +spring.datasource.password=123456 + -- Gitee From f4c86ef58c2d55ce0333004e799342967d58a486 Mon Sep 17 00:00:00 2001 From: ccw <1163730411@qq.com> Date: Tue, 4 Jul 2017 19:55:54 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86README=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86Postgresql=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/POSTGRESQLCREATETABLE.sql | 52 ++++++++++++++++++++++++++++++++ server/README.md | 7 ++++- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 server/POSTGRESQLCREATETABLE.sql diff --git a/server/POSTGRESQLCREATETABLE.sql b/server/POSTGRESQLCREATETABLE.sql new file mode 100644 index 0000000..2ff8a3f --- /dev/null +++ b/server/POSTGRESQLCREATETABLE.sql @@ -0,0 +1,52 @@ +REATE TABLE public.users +( + id integer NOT NULL DEFAULT nextval('users_id_seq'::regclass), + image text COLLATE pg_catalog."default" NOT NULL DEFAULT ''::text, + password text COLLATE pg_catalog."default" NOT NULL, + username text COLLATE pg_catalog."default" NOT NULL, + enabled text COLLATE pg_catalog."default" NOT NULL DEFAULT 1, + CONSTRAINT users_pkey PRIMARY KEY (id) +) +WITH ( + OIDS = FALSE +) +TABLESPACE pg_default; + +ALTER TABLE public.users + OWNER to postgres; + +--authorities-- + +CREATE TABLE public.authorities +( + id integer NOT NULL DEFAULT nextval('authorities_id_seq'::regclass), + username text COLLATE pg_catalog."default" NOT NULL, + authority text COLLATE pg_catalog."default" NOT NULL, + CONSTRAINT authorities_pkey PRIMARY KEY (id) +) +WITH ( + OIDS = FALSE +) +TABLESPACE pg_default; + +ALTER TABLE public.authorities + OWNER to postgres; + +--news-- + +CREATE TABLE public.news +( + id integer NOT NULL DEFAULT nextval('news_id_seq'::regclass), + title text COLLATE pg_catalog."default" NOT NULL, + img text COLLATE pg_catalog."default" NOT NULL, + content text COLLATE pg_catalog."default" NOT NULL, + datetime date NOT NULL, + CONSTRAINT news_pkey PRIMARY KEY (id) +) +WITH ( + OIDS = FALSE +) +TABLESPACE pg_default; + +ALTER TABLE public.news + OWNER to postgres; \ No newline at end of file diff --git a/server/README.md b/server/README.md index 4e6c88c..67eed1a 100644 --- a/server/README.md +++ b/server/README.md @@ -30,7 +30,12 @@ ## 启动应用步骤: - git clone https://git.oschina.net/sectong/yidongyi.git (主站点) or git clone https://github.com/sectong/yidongyi (备份站点) - - import to Eclipse; + - import to Eclipse; + - 切换至postgresql分支 + ``` + git checkout postgresql-connector + ``` + - 在PostgreSQL数据库中运行sql脚本 - run ``` -- Gitee