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

WIP - adding KALI support #2

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
.coverage
*.pyc
.tox/
legi.sqlite*
*.sqlite*
/tarballs/
.vscode
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ exemple avec [cron][cron] :

(`chronic` fait partie des [`moreutils`](http://joeyh.name/code/moreutils/).)

L'option `--base JORF` permet de créer une base JORF au lieu d'une base LEGI.
L'option `--base` permet d'utiliser la base JORF ou KALI au lieu de la base LEGI.

## Fonctionnalités

Expand Down
45 changes: 33 additions & 12 deletions legi/sql/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ CREATE TABLE textes
CREATE TABLE textes_structs
( id char(20) unique not null
, versions text
, dossier text not null
, dossier text
, cid char(20) not null
, mtime int not null
);
Expand Down Expand Up @@ -49,7 +49,7 @@ CREATE TABLE textes_versions
, nota text
, abro text
, rect text
, dossier text not null
, dossier text
, cid char(20) not null
, mtime int not null
, texte_id int references textes
Expand All @@ -63,7 +63,7 @@ CREATE TABLE sections
, titre_ta text
, commentaire text
, parent char(20) -- REFERENCES sections(id)
, dossier text not null
, dossier text
, cid char(20) not null
, mtime int not null
);
Expand All @@ -78,15 +78,15 @@ CREATE TABLE articles
, type text
, nota text
, bloc_textuel text
, dossier text not null
, dossier text
, cid char(20) not null
, mtime int not null
);

CREATE TABLE sommaires
( cid char(20) not null
, parent char(20) -- REFERENCES sections
, element char(20) not null -- REFERENCES articles OR sections
( cid char(20)
, parent char(20) -- REFERENCES sections OR conteneurs
, element char(20) not null -- REFERENCES textes OR articles OR sections
, debut day
, fin day
, etat text
Expand All @@ -113,12 +113,12 @@ CREATE INDEX liens_dst_idx ON liens (dst_id) WHERE _reversed;
CREATE TABLE duplicate_files
( id char(20) not null
, sous_dossier text not null
, cid char(20) not null
, dossier text not null
, cid char(20)
, dossier text
, mtime int not null
, data text not null
, other_cid char(20) not null
, other_dossier text not null
, other_cid char(20)
, other_dossier text
, other_mtime int not null
, UNIQUE (id, sous_dossier, cid, dossier)
);
Expand All @@ -132,7 +132,7 @@ CREATE TABLE textes_versions_brutes
, autorite text
, num text
, date_texte day
, dossier text not null
, dossier text
, cid char(20) not null
, mtime int not null
);
Expand All @@ -149,3 +149,24 @@ CREATE VIEW textes_versions_brutes_view AS
FROM textes_versions a
LEFT JOIN textes_versions_brutes b
ON b.id = a.id AND b.cid = a.cid AND b.dossier = a.dossier AND b.mtime = a.mtime;

CREATE TABLE conteneurs
( id char(20) unique not null
, titre text
, etat text
, num text
, date_publi day
, mtime int not null
);

CREATE INDEX conteneurs_id_idx ON conteneurs (id);
CREATE INDEX conteneurs_num_idx ON conteneurs (num);

CREATE TABLE tetiers
( id char(20) unique not null
, titre_tm text not null
, niv int not null
, conteneur_id int not null
);

CREATE INDEX tetiers_id_idx ON tetiers (id);
Loading