Skip to content

Commit

Permalink
Merge pull request #5 from homanp/datasource-table
Browse files Browse the repository at this point in the history
Datasource table
  • Loading branch information
homanp authored Oct 2, 2023
2 parents d17e68d + 86bf5cf commit eb5a54c
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 10 deletions.
10 changes: 0 additions & 10 deletions lib/prisma/schema.prisma

This file was deleted.

Empty file added lib/service/__init__.py
Empty file.
18 changes: 18 additions & 0 deletions prisma/migrations/20231002092638_datasource/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-- CreateEnum
CREATE TYPE "DatasourceType" AS ENUM ('TXT', 'PDF', 'CSV', 'MARKDOWN');

-- CreateEnum
CREATE TYPE "DatasourceStatus" AS ENUM ('IN_PROGRESS', 'DONE', 'FAILED');

-- CreateTable
CREATE TABLE "Datasource" (
"id" TEXT NOT NULL,
"content" TEXT,
"status" "DatasourceStatus" NOT NULL DEFAULT 'IN_PROGRESS',
"type" "DatasourceType" NOT NULL,
"url" TEXT,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,

CONSTRAINT "Datasource_pkey" PRIMARY KEY ("id")
);
3 changes: 3 additions & 0 deletions prisma/migrations/migration_lock.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (i.e. Git)
provider = "postgresql"
33 changes: 33 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
generator client {
provider = "prisma-client-py"
interface = "asyncio"
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
shadowDatabaseUrl = env("DATABASE_SHADOW_URL")
}

enum DatasourceType {
TXT
PDF
CSV
MARKDOWN
}

enum DatasourceStatus {
IN_PROGRESS
DONE
FAILED
}

model Datasource {
id String @id @default(uuid())
content String? @db.Text()
status DatasourceStatus @default(IN_PROGRESS)
type DatasourceType
url String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}

0 comments on commit eb5a54c

Please sign in to comment.