Skip to content
Open
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
5 changes: 4 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ NC_ALLOW_LOCAL_HOOKS=true
# YOYO-MIGRATION
YOYO_DB=postgresql+psycopg://localhost:5432?user=admin&password=admin&database=adapt_explore
YOYO_SRC=migrations
YOYO_VERBOSITY=2
YOYO_VERBOSITY=2

# FRONTEND
DATABASE_URL=postgresql://admin:admin@localhost/adapt_explore
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["biomejs.biome"]
}
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"biome.lsp.bin": "./frontend/node_modules/@biomejs/cli-linux-x64/biome",
"[typescript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "biomejs.biome",
"editor.codeActionsOnSave": {
"source.organizeImports.biome": "explicit",
"source.fixAll.biome": "explicit"
}
}
}
60 changes: 60 additions & 0 deletions database/migrations/20261115_01_nZwIe-init.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
-- init
-- depends

CREATE TABLE localisations (
id serial CONSTRAINT localisations_pk PRIMARY KEY,
geo_point point NOT NULL,
ville text,
code_postale text,
region text,
departement text,
pays text
);

CREATE TABLE aleas (
id serial CONSTRAINT aleas_pk PRIMARY KEY,
nom text NOT NULL,
commentaire text
);

CREATE TABLE initiatives (
id serial CONSTRAINT initiatives_pk PRIMARY KEY,
titre text,
type_initiative text,
liens text,
images text,
description text,
alea_id integer REFERENCES aleas,
type_porteur_initiative text,
nom_porteur text,
localisation integer REFERENCES localisations
);

CREATE TABLE sources (
id serial CONSTRAINT sources_pk PRIMARY KEY,
nom text NOT NULL,
type text
);

CREATE TABLE tasks (
id serial CONSTRAINT tasks_pk PRIMARY KEY,
source_id integer NOT NULL UNIQUE,
nom text NOT NULL,
next_run timestamp,
last_run timestamp,
locked boolean
);

CREATE TABLE tasks_jobs (
id bigserial CONSTRAINT tasks_jobs_pk PRIMARY KEY,
task_id integer NOT NULL REFERENCES tasks,
status text,
job_timeout integer,
ttl integer
);

CREATE TABLE tasks_jobs_summaries (
id bigserial CONSTRAINT tasks_jobs_summaries_pk PRIMARY KEY,
job_id bigint NOT NULL REFERENCES tasks_jobs UNIQUE,
message text
);
2 changes: 2 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

drizzle
13 changes: 13 additions & 0 deletions frontend/drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import "dotenv/config";
import { defineConfig } from "drizzle-kit";

export default defineConfig({
out: "./drizzle",
schema: "./src/db/schema.ts",
dialect: "postgresql",
dbCredentials: {
url: process.env.DATABASE_URL as string,
},
schemaFilter: ["public"],
tablesFilter: ["!?(_)yoyo*"],
});
Loading
Loading