text: -- CreateEnum
  CREATE TYPE "DatabaseType" AS ENUM ('mysql', 'postgres', 'mariadb', 'mongo', 'redis', 'memcached', 'rabbitmq', 'couchdb', 'rethinkdb', 'elasticsearch', 'clickhouse');
  
  -- CreateEnum
  CREATE TYPE "DeploymentType" AS ENUM ('docker', 'github', 'git');
  
  -- CreateTable
  CREATE TABLE "accounts" (
      "id" TEXT NOT NULL,
      "name" TEXT,
      "email" TEXT NOT NULL,
      "password" TEXT NOT NULL,
      "otp_secret" TEXT,
      "avatar" TEXT,
      "tokens" JSONB,
      "admin" BOOLEAN NOT NULL DEFAULT false,
      "created" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
      "updated" TIMESTAMP(3) NOT NULL,
  
      CONSTRAINT "accounts_pkey" PRIMARY KEY ("id")
  );
  
  -- CreateTable
  CREATE TABLE "activity" (
      "id" TEXT NOT NULL,
      "action" TEXT NOT NULL,
      "ip" TEXT NOT NULL,
      "owner" TEXT DEFAULT 'Deleted User',
      "created" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
  
      CONSTRAINT "activity_pkey" PRIMARY KEY ("id")
  );
  
  -- CreateTable
  CREATE TABLE "certs" (
      "id" TEXT NOT NULL,
      "issuer" TEXT,
      "verification_method" TEXT,
      "request_method" TEXT,
      "common_names" TEXT,
      "status" TEXT NOT NULL,
      "logs" TEXT,
      "project" TEXT NOT NULL,
      "domain" TEXT NOT NULL,
      "owner" TEXT DEFAULT 'Deleted User',
      "expires" TIMESTAMP(3),
      "created" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
      "updated" TIMESTAMP(3) NOT NULL,
  
      CONSTRAINT "certs_pkey" PRIMARY KEY ("id")
  );
  
  -- CreateTable
  CREATE TABLE "databases" (
      "id" TEXT NOT NULL,
      "name" TEXT NOT NULL,
      "description" TEXT,
      "owner" TEXT DEFAULT 'Deleted User',
      "type" "DatabaseType" NOT NULL,
      "version" TEXT NOT NULL,
      "status" TEXT NOT NULL,
      "dsn" TEXT,
      "port" TEXT,
      "backup" TEXT,
      "created" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
      "updated" TIMESTAMP(3) NOT NULL,
  
      CONSTRAINT "databases_pkey" PRIMARY KEY ("id")
  );
  
  -- CreateTable
  CREATE TABLE "deployments" (
      "id" TEXT NOT NULL,
      "origin" TEXT NOT NULL,
      "type" "DeploymentType" NOT NULL,
      "branch" TEXT,
      "status" TEXT NOT NULL,
      "commit" TEXT,
      "message" TEXT,
      "manual" BOOLEAN NOT NULL,
      "rollback" BOOLEAN NOT NULL DEFAULT false,
      "logs" TEXT,
      "project" TEXT NOT NULL,
      "owner" TEXT DEFAULT 'Deleted User',
      "created" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
      "updated" TIMESTAMP(3) NOT NULL,
  
      CONSTRAINT "deployments_pkey" PRIMARY KEY ("id")
  );
  
  -- CreateTable
  CREATE TABLE "domains" (
      "id" TEXT NOT NULL,
      "domain" TEXT NOT NULL,
      "project" TEXT NOT NULL,
      "owner" TEXT DEFAULT 'Deleted User',
      "created" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
      "updated" TIMESTAMP(3) NOT NULL,
  
      CONSTRAINT "domains_pkey" PRIMARY KEY ("id")
  );
  
  -- CreateTable
  CREATE TABLE "environment_variables" (
      "id" TEXT NOT NULL,
      "key" TEXT NOT NULL,
      "value" TEXT NOT NULL,
      "project" TEXT NOT NULL,
      "owner" TEXT DEFAULT 'Deleted User',
      "created" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
      "updated" TIMESTAMP(3) NOT NULL,
  
      CONSTRAINT "environment_variables_pkey" PRIMARY KEY ("id")
  );
  
  -- CreateTable
  CREATE TABLE "links" (
      "id" TEXT NOT NULL,
      "project" TEXT NOT NULL,
      "database" TEXT NOT NULL,
      "created" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
  
      CONSTRAINT "links_pkey" PRIMARY KEY ("id")
  );
  
  -- CreateTable
  CREATE TABLE "port_mappings" (
      "id" TEXT NOT NULL,
      "scheme" TEXT NOT NULL,
      "host" TEXT NOT NULL,
      "container" TEXT NOT NULL,
      "project" TEXT NOT NULL,
      "owner" TEXT DEFAULT 'Deleted User',
      "created" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
      "updated" TIMESTAMP(3) NOT NULL,
  
      CONSTRAINT "port_mappings_pkey" PRIMARY KEY ("id")
  );
  
  -- CreateTable
  CREATE TABLE "projects" (
      "id" TEXT NOT NULL,
      "name" TEXT NOT NULL,
      "description" TEXT,
      "maintenance" BOOLEAN NOT NULL DEFAULT false,
      "origin" TEXT,
      "owner" TEXT DEFAULT 'Deleted User',
      "created" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
      "updated" TIMESTAMP(3) NOT NULL,
      "deleted" TIMESTAMP(3),
  
      CONSTRAINT "projects_pkey" PRIMARY KEY ("id")
  );
  
  -- CreateIndex
  CREATE UNIQUE INDEX "accounts_email_key" ON "accounts"("email");
  
  -- CreateIndex
  CREATE UNIQUE INDEX "databases_dsn_key" ON "databases"("dsn");
  
  -- AddForeignKey
  ALTER TABLE "activity" ADD CONSTRAINT "activity_owner_fkey" FOREIGN KEY ("owner") REFERENCES "accounts"("id") ON DELETE SET DEFAULT ON UPDATE CASCADE;
  
  -- AddForeignKey
  ALTER TABLE "certs" ADD CONSTRAINT "certs_domain_fkey" FOREIGN KEY ("domain") REFERENCES "domains"("id") ON DELETE CASCADE ON UPDATE CASCADE;
  
  -- AddForeignKey
  ALTER TABLE "certs" ADD CONSTRAINT "certs_owner_fkey" FOREIGN KEY ("owner") REFERENCES "accounts"("id") ON DELETE SET DEFAULT ON UPDATE CASCADE;
  
  -- AddForeignKey
  ALTER TABLE "certs" ADD CONSTRAINT "certs_project_fkey" FOREIGN KEY ("project") REFERENCES "projects"("id") ON DELETE CASCADE ON UPDATE CASCADE;
  
  -- AddForeignKey
  ALTER TABLE "databases" ADD CONSTRAINT "databases_owner_fkey" FOREIGN KEY ("owner") REFERENCES "accounts"("id") ON DELETE SET DEFAULT ON UPDATE CASCADE;
  
  -- AddForeignKey
  ALTER TABLE "deployments" ADD CONSTRAINT "deployments_owner_fkey" FOREIGN KEY ("owner") REFERENCES "accounts"("id") ON DELETE SET DEFAULT ON UPDATE CASCADE;
  
  -- AddForeignKey
  ALTER TABLE "deployments" ADD CONSTRAINT "deployments_project_fkey" FOREIGN KEY ("project") REFERENCES "projects"("id") ON DELETE CASCADE ON UPDATE CASCADE;
  
  -- AddForeignKey
  ALTER TABLE "domains" ADD CONSTRAINT "domains_owner_fkey" FOREIGN KEY ("owner") REFERENCES "accounts"("id") ON DELETE SET DEFAULT ON UPDATE CASCADE;
  
  -- AddForeignKey
  ALTER TABLE "domains" ADD CONSTRAINT "domains_project_fkey" FOREIGN KEY ("project") REFERENCES "projects"("id") ON DELETE CASCADE ON UPDATE CASCADE;
  
  -- AddForeignKey
  ALTER TABLE "environment_variables" ADD CONSTRAINT "environment_variables_owner_fkey" FOREIGN KEY ("owner") REFERENCES "accounts"("id") ON DELETE SET DEFAULT ON UPDATE CASCADE;
  
  -- AddForeignKey
  ALTER TABLE "environment_variables" ADD CONSTRAINT "environment_variables_project_fkey" FOREIGN KEY ("project") REFERENCES "projects"("id") ON DELETE CASCADE ON UPDATE CASCADE;
  
  -- AddForeignKey
  ALTER TABLE "links" ADD CONSTRAINT "links_project_fkey" FOREIGN KEY ("project") REFERENCES "projects"("id") ON DELETE CASCADE ON UPDATE CASCADE;
  
  -- AddForeignKey
  ALTER TABLE "links" ADD CONSTRAINT "links_database_fkey" FOREIGN KEY ("database") REFERENCES "databases"("id") ON DELETE CASCADE ON UPDATE CASCADE;
  
  -- AddForeignKey
  ALTER TABLE "port_mappings" ADD CONSTRAINT "port_mappings_owner_fkey" FOREIGN KEY ("owner") REFERENCES "accounts"("id") ON DELETE SET DEFAULT ON UPDATE CASCADE;
  
  -- AddForeignKey
  ALTER TABLE "port_mappings" ADD CONSTRAINT "port_mappings_project_fkey" FOREIGN KEY ("project") REFERENCES "projects"("id") ON DELETE CASCADE ON UPDATE CASCADE;
  
  -- AddForeignKey
  ALTER TABLE "projects" ADD CONSTRAINT "projects_owner_fkey" FOREIGN KEY ("owner") REFERENCES "accounts"("id") ON DELETE SET DEFAULT ON UPDATE CASCADE;
  