This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE entity ( | |
id INTEGER NOT NULL AUTO_INCREMENT | |
,createdDate TIMESTAMP NOT NULL | |
,createdBy INTEGER NOT NULL | |
,deletedDate TIMESTAMP NULL | |
,status VARCHAR(50) NOT NULL | |
,ownerId INTEGER NOT NULL -- Foreign key to user that currently owns entity | |
,companyId INTEGER NOT NULL -- Foreign key to company that owns entity... never changes | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP TABLE IF EXISTS jobs_history; | |
CREATE TABLE jobs_history | |
( | |
id INTEGER IDENTITY(1, 1) PRIMARY KEY, | |
jobId INTEGER NOT NULL, | |
valid_from TIMESTAMP NOT NULL, | |
valid_to TIMESTAMP NULL, | |
type VARCHAR(50), | |
status VARCHAR(50), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
from enum import Enum | |
import time | |
from typing import Optional | |
from uuid import UUID, uuid4 | |
from fastapi import BackgroundTasks, FastAPI, Request | |
from pydantic import BaseModel, Field |