From d0b2e815c28999334b8eb76474aa728134ae7bb1 Mon Sep 17 00:00:00 2001 From: rkv Date: Mon, 29 Oct 2012 11:29:39 +0000 Subject: [PATCH] SQL scripts for populating and cleaning the database. --- Workspace/Siman/sql/drop_simer_tables.sql | 40 ++++++++++ Workspace/Siman/sql/simer_ini_data.sql | 94 +++++++++++++++++++++++ 2 files changed, 134 insertions(+) create mode 100644 Workspace/Siman/sql/drop_simer_tables.sql create mode 100644 Workspace/Siman/sql/simer_ini_data.sql diff --git a/Workspace/Siman/sql/drop_simer_tables.sql b/Workspace/Siman/sql/drop_simer_tables.sql new file mode 100644 index 0000000..786492f --- /dev/null +++ b/Workspace/Siman/sql/drop_simer_tables.sql @@ -0,0 +1,40 @@ +drop table if exists `refid`; +drop table if exists `comment_attr`; +drop table if exists `descr_attr`; +drop table if exists `text_attr`; +drop table if exists `text_attr`; +drop table if exists `attribute`; +drop table if exists `doctag`; +drop table if exists `docuse`; +drop table if exists `knowelm`; +drop table if exists `knowtype`; +drop table if exists `contributor_rel`; +drop table if exists `converts_rel`; +drop table if exists `cycle_rel`; +drop table if exists `stamp_rel`; +drop table if exists `usedby_rel`; +drop table if exists `uses_rel`; +drop table if exists `versions_rel`; +drop table if exists `relation`; +drop table if exists `cycle`; +drop table if exists `document`; +drop table if exists `entity`; +drop table if exists `projext`; +drop table if exists `stamp`; +drop table if exists `file`; +drop table if exists `doctype`; +drop table if exists `scenario`; +drop table if exists `study`; +drop table if exists `any`; +drop table if exists `contelm`; +drop table if exists `contype`; +drop table if exists `user`; +drop table if exists `users`; +drop table if exists `role`; +drop table if exists `relation_id`; +drop table if exists `persistent_id`; +drop table if exists `text`; +SHOW TABLE STATUS FROM `simer`; +SHOW FUNCTION STATUS WHERE `Db`='simer'; +SHOW PROCEDURE STATUS WHERE `Db`='simer'; +SHOW TRIGGERS FROM `simer`; \ No newline at end of file diff --git a/Workspace/Siman/sql/simer_ini_data.sql b/Workspace/Siman/sql/simer_ini_data.sql new file mode 100644 index 0000000..49fd04c --- /dev/null +++ b/Workspace/Siman/sql/simer_ini_data.sql @@ -0,0 +1,94 @@ +# -------------------------------------------------------- +# Host: 172.22.0.166 +# Database: simer1 +# Server version: 5.0.45-community-nt +# Server OS: Win32 +# HeidiSQL version: 5.0.0.3272 +# Date/time: 2012-09-27 14:29:24 +# -------------------------------------------------------- + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET NAMES utf8 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +# Dumping data for table simer1.any: 1 rows +# Dumping data for table simer1.attribute: 12 rows +DELETE FROM `attribute`; + +# Dumping data for table simer1.contelm: 31 rows +DELETE FROM `contelm`; +/*!40000 ALTER TABLE `contelm` DISABLE KEYS */; +INSERT INTO `contelm` (`rid`, `type`, `step`, `state`, `value`, `counter`) VALUES (41, 31, 1, 'APPROVED', 'CEA Cadarache', 1), (42, 32, 1, 'APPROVED', 'Réacteur RAPSODIE', 3), (43, 33, 1, 'APPROVED', 'Démantèlement', 1), (44, 34, 1, 'APPROVED', 'Caractérisation du béton SERCOTER', 1), (45, 35, 1, 'APPROVED', 'Valider les résultats d\'une précédente étude', 1), (46, 36, 1, 'APPROVED', 'Transport de particules', 2), (47, 37, 3, 'APPROVED', 'Réacteur nucléaire', 1), (48, 38, 3, 'APPROVED', 'Ensemble Bloc réacteur et Enceinte en béton', 1), (49, 39, 4, 'APPROVED', 'Éléments finis', 1), (410, 310, 4, 'APPROVED', 'Surfacique', 1), (411, 311, 4, 'APPROVED', 'Triangles', 1), (412, 314, 6, 'APPROVED', 'NARVEOS V3', 1), (413, 315, 6, 'APPROVED', 'NARMER V2', 1), (414, 316, 6, 'APPROVED', 'VIRTOOLS V5', 1), (415, 31, 1, 'APPROVED', 'Fonction transverse sûreté', 1), (416, 32, 1, 'APPROVED', 'Laser Mégajoule (LMJ)', 3), (417, 33, 1, 'APPROVED', 'Dossier de Validation DSGA/SSPP', 1), (418, 34, 1, 'APPROVED', 'Validation du calcul TRIPOLI4.5 via le PlugIn Pro/E', 1), (419, 35, 1, 'APPROVED', 'Cartographie neutronique', 1), (420, 37, 3, 'APPROVED', 'Bâtiment LMJ', 1), (421, 38, 3, 'APPROVED', 'Bât. Nord, Sud, Hall d\'expériences, Hall lasers', 1), (422, 39, 4, 'APPROVED', 'CSG', 1), (423, 310, 4, 'APPROVED', 'Monte Carlo ', 1), (424, 311, 4, 'APPROVED', 'Combinatoire volumique', 1), (425, 314, 6, 'APPROVED', 'SALOME-TRIPOLI V2.04', 1), (426, 315, 6, 'APPROVED', 'TRIPOLI4.5', 1), (427, 32, 1, 'inCHECK', '_A380', 1), (428, 31, 1, 'inCHECK', '_Airbus', 1), (429, 35, 1, 'inCHECK', 'Analyse de l\'impact foudre', 1), (430, 36, 1, 'inCHECK', 'Équation de Maxwell', 1), (431, 37, 3, 'inCHECK', '_Avion', 4); +/*!40000 ALTER TABLE `contelm` ENABLE KEYS */; + +# Dumping data for table simer1.contype: 16 rows +DELETE FROM `contype`; +/*!40000 ALTER TABLE `contype` DISABLE KEYS */; +INSERT INTO `contype` (`rid`, `name`, `state`, `step`) VALUES (31, 'customer', 'APPROVED', 1), (32, 'product', 'APPROVED', 1), (33, 'phase', 'APPROVED', 1), (34, 'need', 'APPROVED', 1), (35, 'purpose', 'APPROVED', 1), (36, 'physic', 'APPROVED', 1), (37, 'object', 'APPROVED', 3), (38, 'part', 'APPROVED', 3), (39, 'model', 'APPROVED', 4), (310, 'element', 'APPROVED', 4), (311, 'shape', 'APPROVED', 4), (312, 'order', 'APPROVED', 4), (313, 'analysis', 'APPROVED', 5), (314, 'platform', 'APPROVED', 6), (315, 'module', 'APPROVED', 6), (316, 'component', 'APPROVED', 6); +/*!40000 ALTER TABLE `contype` ENABLE KEYS */; + +# Dumping data for table simer1.cycle: 4 rows +DELETE FROM `cycle`; +/*!40000 ALTER TABLE `cycle` DISABLE KEYS */; +INSERT INTO `cycle` (`rid`, `type`, `publisher`, `reviewer`, `approver`, `signatory`) VALUES (51, 24, NULL, 3, 2, NULL), (52, 210, 8, 6, 7, NULL), (53, 24, NULL, 3, 8, NULL), (54, 22, NULL, 7, 7, NULL); +/*!40000 ALTER TABLE `cycle` ENABLE KEYS */; + +# Dumping data for table simer1.doctag: 30 rows +DELETE FROM `doctag`; + +# Dumping data for table simer1.doctype: 12 rows +DELETE FROM `doctype`; +/*!40000 ALTER TABLE `doctype` DISABLE KEYS */; +INSERT INTO `doctype` (`rid`, `name`, `state`, `step`, `result`) VALUES (21, 'requirements', 'APPROVED', '-1-', NULL), (22, 'specification', 'APPROVED', '-1-', '1'), (23, 'design', 'APPROVED', '-2-', '2'), (24, 'geometry', 'APPROVED', '-3-', '3'), (25, 'model', 'APPROVED', '-4-', '4'), (26, 'loads', 'APPROVED', '-5-', '5'), (27, 'script', 'APPROVED', '-5-', NULL), (28, 'log', 'APPROVED', '-6-', NULL), (29, 'results', 'APPROVED', '-6-', '6'), (210, 'report', 'APPROVED', '-9-', '9'), (211, 'memorandum', 'APPROVED', '-2-3-4-7-', NULL), (212, 'minutes', 'APPROVED', '-1-2-3-4-5-6-7-9-', NULL); +/*!40000 ALTER TABLE `doctype` ENABLE KEYS */; + +# Dumping data for table simer1.document: 33 rows +DELETE FROM `document`; + +# Dumping data for table simer1.docuse: 9 rows +DELETE FROM `docuse`; + +# Dumping data for table simer1.file: 42 rows +DELETE FROM `file`; + +# Dumping data for table simer1.knowelm: 23 rows +DELETE FROM `knowelm`; + +# Dumping data for table simer1.knowtype: 6 rows +DELETE FROM `knowtype`; +/*!40000 ALTER TABLE `knowtype` DISABLE KEYS */; +INSERT INTO `knowtype` (`rid`, `name`, `state`) VALUES (11, 'usecase', 'inWORK'), (12, 'bestpractice', 'APPROVED'), (13, 'limitation', 'APPROVED'), (14, 'inconsistency', 'APPROVED'), (15, 'metrics', 'APPROVED'), (16, 'improvement', 'APPROVED'); +/*!40000 ALTER TABLE `knowtype` ENABLE KEYS */; + +# Dumping data for table simer1.projext: 39 rows +DELETE FROM `projext`; + +# Dumping data for table simer1.refid: 3 rows +DELETE FROM `refid`; + +# Dumping data for table simer1.role: 9 rows +DELETE FROM `role`; +/*!40000 ALTER TABLE `role` DISABLE KEYS */; +INSERT INTO `role` (`username`, `role`) VALUES ('simer', 'sysadmin'), ('jbt', 'manager'), ('hl', 'manager'), ('pdd', 'studengineer'), ('sdd', 'manager'), ('mko', 'manager'), ('pjt', 'manager'), ('rkv', 'manager'), ('xyz', 'user'); +/*!40000 ALTER TABLE `role` ENABLE KEYS */; + +# Dumping data for table simer1.scenario: 11 rows +DELETE FROM `scenario`; + +# Dumping data for table simer1.stamp: 23 rows +DELETE FROM `stamp`; + +# Dumping data for table simer1.study: 7 rows +DELETE FROM `study`; + +# Dumping data for table simer1.text_attr: 0 rows +DELETE FROM `text_attr`; + +# Dumping data for table simer1.users: 9 rows +DELETE FROM `users`; +/*!40000 ALTER TABLE `users` DISABLE KEYS */; +INSERT INTO `users` (`rid`, `username`, `password`, `first`, `last`, `display`, `email`, `organid`) VALUES (1, 'simer', '92668751', 'Manager', 'Simulation', 'label.sysadmin', 'noreply@salome-platform.org', NULL), (2, 'jbt', NULL, 'Jean-Bernard', 'Trépon', 'Jean-Bernard Trépon', 'jean-bernard.trepon@euriware.fr', 'Euriware'), (3, 'hl', NULL, 'Hervé', 'Lexpert', 'Hervé', 'herve.lexpert@opencascade.com', 'OC-F'), (4, 'pdd', NULL, 'Paul', 'Durand', NULL, 'paul.durand@euriware.fr', 'Euriware'), (5, 'sdd', NULL, 'Sylvie', 'Dupond', NULL, 'sylvie.dupond@cea.fr', 'CEA'), (6, 'mko', NULL, 'Michel', 'Karyo', NULL, 'michel.karyo@opencascade.com', 'Nx1'), (7, 'pjt', NULL, 'Pierre', 'Jarnet', NULL, 'pierre.jarnet@euriware.fr', 'Nx2'), (8, 'rkv', NULL, 'Roman', 'Kozlov', 'Roman Kozlov', 'roman.kozlov@opencascade.com', 'OC-N'), (9, 'xyz', NULL, 'My surname', 'My name', 'Any string', 'me@provider.fr', NULL); +/*!40000 ALTER TABLE `users` ENABLE KEYS */; +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -- 2.39.2