can create a server

This commit is contained in:
2019-12-19 17:24:20 +01:00
parent 77ed63784b
commit ddd97fb59c
9 changed files with 130 additions and 142 deletions

View File

@ -44,37 +44,14 @@ CREATE TABLE ApplicationService (
UNIQUE (ApplicationServiceName, ApplicationServiceReleaseId)
);
-- Création de la table de jointure ApplicationServiceProvides
CREATE TABLE ApplicationServiceProvides (
ApplicationServiceId INTEGER NOT NULL,
VirtualApplicationServiceId INTEGER NOT NULL,
FOREIGN KEY (ApplicationServiceId) REFERENCES ApplicationService(ApplicationServiceId),
FOREIGN KEY (VirtualApplicationServiceId) REFERENCES ApplicationService(ApplicationServiceId),
PRIMARY KEY (ApplicationServiceId, VirtualApplicationServiceId)
-- Server table creation
CREATE TABLE Server (
ServerId SERIAL PRIMARY KEY,
ServerName VARCHAR(255) NOT NULL,
ServerDescription VARCHAR(255) NOT NULL,
ServerServermodelId INTEGER NOT NULL
);
-- Création de la table Package
CREATE TABLE Package (
PackageId SERIAL PRIMARY KEY,
PackageApplicationServiceId INTEGER,
PackageName VARCHAR(255) NOT NULL,
FOREIGN KEY (PackageApplicationServiceId) REFERENCES ApplicationService(ApplicationServiceId)
);
-- Création de la table Document
CREATE TABLE Document (
DocumentId SERIAL PRIMARY KEY,
DocumentServiceId INTEGER,
DocumentName VARCHAR(255) NOT NULL,
DocumentPath TEXT,
DocumentOwner VARCHAR(255) DEFAULT 'root',
DocumentGroup VARCHAR(255) DEFAULT 'root',
DocumentMode VARCHAR(10) DEFAULT '0644',
DocumentType VARCHAR(100) CHECK ( DocumentType IN ('probes', 'aggregated_dico', 'dico', 'template', 'pretemplate', 'posttemplate', 'preservice', 'postservice', 'creolefuncs', 'file') ),
DocumentSHASUM VARCHAR(255),
DocumentContent BYTEA,
FOREIGN KEY (DocumentServiceId) REFERENCES ApplicationService(ApplicationServiceId)
);
"""
async def main():