From 735c99e4ae360000254710c631cc201290df331a Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Wed, 7 Oct 2015 19:52:46 -0400 Subject: Add default links in sql dump --- Makefile | 2 ++ app/Schema/Sql/mysql.sql | 21 ++++++++++++++++++++- app/Schema/Sql/postgres.sql | 43 ++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 64 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e56458e9..62fa341f 100644 --- a/Makefile +++ b/Makefile @@ -91,9 +91,11 @@ unittest: test-sqlite test-mysql test-postgres sql: @ pg_dump --schema-only --no-owner --file app/Schema/Sql/postgres.sql kanboard @ pg_dump -d kanboard --column-inserts --data-only --table settings >> app/Schema/Sql/postgres.sql + @ pg_dump -d kanboard --column-inserts --data-only --table links >> app/Schema/Sql/postgres.sql @ mysqldump -uroot --quote-names --no-create-db --skip-comments --no-data --single-transaction kanboard | sed 's/ AUTO_INCREMENT=[0-9]*//g' > app/Schema/Sql/mysql.sql @ mysqldump -uroot --quote-names --no-create-info --skip-comments --no-set-names kanboard settings >> app/Schema/Sql/mysql.sql + @ mysqldump -uroot --quote-names --no-create-info --skip-comments --no-set-names kanboard links >> app/Schema/Sql/mysql.sql @ php -r "echo 'INSERT INTO users (username, password, is_admin) VALUES (\'admin\', \''.password_hash('admin', PASSWORD_DEFAULT).'\', \'1\');';" | \ tee -a app/Schema/Sql/postgres.sql app/Schema/Sql/mysql.sql >/dev/null diff --git a/app/Schema/Sql/mysql.sql b/app/Schema/Sql/mysql.sql index c335a16f..280735f1 100644 --- a/app/Schema/Sql/mysql.sql +++ b/app/Schema/Sql/mysql.sql @@ -540,4 +540,23 @@ UNLOCK TABLES; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -INSERT INTO users (username, password, is_admin) VALUES ('admin', '$2y$10$ORQCf1YIxrkMyA9V1cphcOVZKckWumuZXig9hsk5I6EH1p1Z1pHsO', '1');INSERT INTO schema_version VALUES ('90'); +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!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' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +LOCK TABLES `links` WRITE; +/*!40000 ALTER TABLE `links` DISABLE KEYS */; +INSERT INTO `links` VALUES (1,'relates to',0),(2,'blocks',3),(3,'is blocked by',2),(4,'duplicates',5),(5,'is duplicated by',4),(6,'is a child of',7),(7,'is a parent of',6),(8,'targets milestone',9),(9,'is a milestone of',8),(10,'fixes',11),(11,'is fixed by',10); +/*!40000 ALTER TABLE `links` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +INSERT INTO users (username, password, is_admin) VALUES ('admin', '$2y$10$ZkZIbCTR/OrzhRTOx.UZZeaInO85/1N/j4zxb7WCrNpO9hjFM1mUC', '1');INSERT INTO schema_version VALUES ('90'); diff --git a/app/Schema/Sql/postgres.sql b/app/Schema/Sql/postgres.sql index 42fbe484..5b3bb551 100644 --- a/app/Schema/Sql/postgres.sql +++ b/app/Schema/Sql/postgres.sql @@ -1899,4 +1899,45 @@ INSERT INTO settings (option, value) VALUES ('cfd_include_closed_tasks', '1'); -- PostgreSQL database dump complete -- -INSERT INTO users (username, password, is_admin) VALUES ('admin', '$2y$10$ORQCf1YIxrkMyA9V1cphcOVZKckWumuZXig9hsk5I6EH1p1Z1pHsO', '1');INSERT INTO schema_version VALUES ('70'); +-- +-- PostgreSQL database dump +-- + +SET statement_timeout = 0; +SET lock_timeout = 0; +SET client_encoding = 'UTF8'; +SET standard_conforming_strings = on; +SET check_function_bodies = false; +SET client_min_messages = warning; + +SET search_path = public, pg_catalog; + +-- +-- Data for Name: links; Type: TABLE DATA; Schema: public; Owner: postgres +-- + +INSERT INTO links (id, label, opposite_id) VALUES (1, 'relates to', 0); +INSERT INTO links (id, label, opposite_id) VALUES (2, 'blocks', 3); +INSERT INTO links (id, label, opposite_id) VALUES (3, 'is blocked by', 2); +INSERT INTO links (id, label, opposite_id) VALUES (4, 'duplicates', 5); +INSERT INTO links (id, label, opposite_id) VALUES (5, 'is duplicated by', 4); +INSERT INTO links (id, label, opposite_id) VALUES (6, 'is a child of', 7); +INSERT INTO links (id, label, opposite_id) VALUES (7, 'is a parent of', 6); +INSERT INTO links (id, label, opposite_id) VALUES (8, 'targets milestone', 9); +INSERT INTO links (id, label, opposite_id) VALUES (9, 'is a milestone of', 8); +INSERT INTO links (id, label, opposite_id) VALUES (10, 'fixes', 11); +INSERT INTO links (id, label, opposite_id) VALUES (11, 'is fixed by', 10); + + +-- +-- Name: links_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres +-- + +SELECT pg_catalog.setval('links_id_seq', 11, true); + + +-- +-- PostgreSQL database dump complete +-- + +INSERT INTO users (username, password, is_admin) VALUES ('admin', '$2y$10$ZkZIbCTR/OrzhRTOx.UZZeaInO85/1N/j4zxb7WCrNpO9hjFM1mUC', '1');INSERT INTO schema_version VALUES ('70'); -- cgit v1.2.3