create app schema if not exists without relying on init.sql

This commit is contained in:
DESKTOP-T0O5CDB\DESK-555BD
2024-10-05 12:03:46 -06:00
parent 08cee8029f
commit 1ce77ad1ee
18 changed files with 18 additions and 17 deletions

View File

@@ -34,6 +34,7 @@ namespace CarCareTracker.Controllers
{
var cmds = new List<string>
{
"CREATE SCHEMA IF NOT EXISTS app",
"CREATE TABLE IF NOT EXISTS app.vehicles (id INT GENERATED BY DEFAULT AS IDENTITY primary key, data jsonb not null)",
"CREATE TABLE IF NOT EXISTS app.collisionrecords (id INT GENERATED BY DEFAULT AS IDENTITY primary key, vehicleId INT not null, data jsonb not null)",
"CREATE TABLE IF NOT EXISTS app.upgraderecords (id INT GENERATED BY DEFAULT AS IDENTITY primary key, vehicleId INT not null, data jsonb not null)",