initial commit

This commit is contained in:
Ken Yasue
2025-06-01 22:21:33 +02:00
commit 5149012dcf
30 changed files with 6346 additions and 0 deletions

22
schema/data-source.ts Normal file
View File

@ -0,0 +1,22 @@
"use node"
import "reflect-metadata"
import { DataSource, EntitySchema } from "typeorm"
import { classLoader } from "./loader"
const isProduction = process.env.NODE_ENV === "production"
export const dataSource = new DataSource({
type: "postgres",
host: "localhost",
port: 5432,
username: "test",
password: "test",
database: "photo",
synchronize: !isProduction,
logging: !isProduction,
migrationsRun: false,
entities: classLoader("entity") as EntitySchema[],
migrations: classLoader("migration") as Function[],
subscribers: [],
installExtensions: true
})