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,