From 830ebc058ddc35cfcffeea07f162148949609458 Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Fri, 21 Jun 2024 09:10:40 +0000 Subject: [PATCH] =?UTF-8?q?chore:=20devcontainer=E3=81=A7=E8=B5=B7?= =?UTF-8?q?=E5=8B=95=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hideout-core/src/main/resources/application.yml | 8 ++++---- .../src/main/resources/db/migration/V1__Init_DB.sql | 10 +++++++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/hideout-core/src/main/resources/application.yml b/hideout-core/src/main/resources/application.yml index 55cec25b..aff7f31c 100644 --- a/hideout-core/src/main/resources/application.yml +++ b/hideout-core/src/main/resources/application.yml @@ -24,17 +24,17 @@ spring: default-property-inclusion: always datasource: driver-class-name: org.postgresql.Driver - url: "jdbc:postgresql:hideout3" + url: "jdbc:postgresql:postgres" username: "postgres" - password: "" + password: "postgres" data: mongodb: auto-index-creation: true host: localhost port: 27017 database: hideout - # username: hideoutuser - # password: hideoutpass + username: root + password: password servlet: multipart: max-file-size: 40MB diff --git a/hideout-core/src/main/resources/db/migration/V1__Init_DB.sql b/hideout-core/src/main/resources/db/migration/V1__Init_DB.sql index fdc8afea..8d9daeaf 100644 --- a/hideout-core/src/main/resources/db/migration/V1__Init_DB.sql +++ b/hideout-core/src/main/resources/db/migration/V1__Init_DB.sql @@ -56,6 +56,8 @@ create table if not exists actors move_to bigint null default null, emojis varchar(3000) not null default '', deleted boolean not null default false, + icon bigint null, + banner bigint null, unique ("name", "domain"), constraint fk_actors_instance__id foreign key ("instance") references instance (id) on delete restrict on update restrict, constraint fk_actors_actors__move_to foreign key ("move_to") references actors (id) on delete restrict on update restrict @@ -86,11 +88,17 @@ create table if not exists media url varchar(255) not null unique, remote_url varchar(255) null unique, thumbnail_url varchar(255) null unique, - "type" varchar(100) not null, + "type" varchar(100) not null, blurhash varchar(255) null, mime_type varchar(255) not null, description varchar(4000) null ); + +alter table actors + add constraint fk_actors_media__icon foreign key ("icon") references media (id) on delete cascade on update cascade; +alter table actors + add constraint fk_actors_media__banner foreign key ("banner") references media (id) on delete cascade on update cascade; + create table if not exists posts ( id bigint primary key,