Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contrainte d'intégrité de la bdd #60

Open
nanls opened this issue Apr 15, 2017 · 4 comments
Open

contrainte d'intégrité de la bdd #60

nanls opened this issue Apr 15, 2017 · 4 comments
Assignees
Labels

Comments

@nanls
Copy link
Owner

nanls commented Apr 15, 2017

C'est genre.. urgentissime, là.

@nanls
Copy link
Owner Author

nanls commented Apr 16, 2017

Si vous avez le temps, réfléchissez à ça sur le shéma des tables, et j'essayerai de me grouiller pour l'implémentation.

@nanls
Copy link
Owner Author

nanls commented Apr 17, 2017

Bon, du coup, ce que je vous propose en contrainte :

CREATE TABLE pdb_file (
	id VARCHAR(4) NOT NULL UNIQUE, 
	seq TEXT NOT NULL, 
	keywords TEXT, 
	name TEXT, 
	head TEXT, 
	deposition_date TEXT, 
	release_date TEXT, 
	structure_method TEXT, 
	resolution FLOAT, 
	structure_reference TEXT, 
	journal_reference TEXT, 
	author TEXT, 
	compound TEXT, 
	PRIMARY KEY (id)
);
CREATE TABLE chain (
	id VARCHAR(1) NOT NULL, 
	pdb_id VARCHAR(4) NOT NULL UNIQUE, 
	start INTEGER NOT NULL , 
	stop INTEGER NOT NULL, 
	PRIMARY KEY (id, pdb_id), 
	FOREIGN KEY(pdb_id) REFERENCES pdb_file (id)
);
CREATE TABLE annotation (
	pdb_id VARCHAR(4) NOT NULL, 
	method VARCHAR NOT NULL, 
	result TEXT NOT NULL, 
	PRIMARY KEY (pdb_id, method), 
	FOREIGN KEY(pdb_id) REFERENCES pdb_file (id)
);
CREATE TABLE angle (
	pdb_id VARCHAR(4) NOT NULL, 
	atom_idx INTEGER NOT NULL, 
	phi FLOAT, 
	psi FLOAT, 
	PRIMARY KEY (pdb_id, atom_idx), 
	FOREIGN KEY(pdb_id) REFERENCES pdb_file (id)
);

@nanls
Copy link
Owner Author

nanls commented Apr 17, 2017

@jecarvaill : t'en voit d'autre, des contraintes d'inté ?

@jecarvaill
Copy link
Collaborator

C'est bon pour moi. Les plus importantes sont soulignées. Le reste peut être considéré comme information annexe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants