summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-05-09 09:48:21 +0200
committerErich Eckner <git@eckner.net>2018-05-09 09:48:21 +0200
commitd9b9a2f81e539357feab0d2cc2e3042c5844294c (patch)
treef807d2c3731e01ed5fbb9b053ae94b2a7bc2fe08
parentc35534f22082b9d5bf23797bd3fbb36f8b738254 (diff)
downloadbuilder-d9b9a2f81e539357feab0d2cc2e3042c5844294c.tar.xz
bin/check-db-structure: add dump of content of "constant" tables
-rwxr-xr-xbin/check-db-structure23
-rw-r--r--misc/database-layout.dump84
2 files changed, 107 insertions, 0 deletions
diff --git a/bin/check-db-structure b/bin/check-db-structure
index 3b85756..5f7d9c2 100755
--- a/bin/check-db-structure
+++ b/bin/check-db-structure
@@ -5,6 +5,8 @@
# shellcheck source=../conf/default.conf
. "${0%/*}/../conf/default.conf"
+# stored functions
+
# shellcheck disable=SC2016
{
printf 'SELECT `proc`.`name` FROM `mysql`.`proc` WHERE `proc`.`Db`="buildmaster"' | \
@@ -18,6 +20,9 @@
s/ \(SELECT\|FROM\|\(LEFT \|RIGHT \)\?JOIN\|ON\|WHERE\) /\n\t\1 /g
s/(SELECT/(\nSELECT/g
'
+
+# table headers
+
# shellcheck disable=SC2016
{
printf 'SHOW TABLES' | \
@@ -31,3 +36,21 @@
s/ AUTO_INCREMENT=[0-9]\+ / /g
s/^ /\t/
'
+
+# content of "constant" tables
+mysqldump --skip-lock-tables 'buildmaster' \
+ 'architectures' \
+ 'dependency_types' \
+ 'email_actions' \
+ 'fail_reasons' \
+ 'git_repositories' \
+ 'repositories' \
+ 'repository_moves' \
+ 'repository_stabilities' \
+ 'repository_stability_relations' \
+ 'upstream_repositories' | \
+ grep '^INSERT ' | \
+ sed '
+ s/),(/),\n (/g
+ s/VALUES (/VALUES\n (/g
+ '
diff --git a/misc/database-layout.dump b/misc/database-layout.dump
index dc0b537..27bbf36 100644
--- a/misc/database-layout.dump
+++ b/misc/database-layout.dump
@@ -601,3 +601,87 @@ upstream_repositories CREATE TABLE `upstream_repositories` (
KEY `git_repository` (`git_repository`),
CONSTRAINT `upstream_repositories_ibfk_1` FOREIGN KEY (`git_repository`) REFERENCES `git_repositories` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
+INSERT INTO `architectures` VALUES
+ (1,'any'),
+ (2,'i686');
+INSERT INTO `dependency_types` VALUES
+ (2,'run','',''),
+ (3,'check','\0','\0'),
+ (4,'link','\0',''),
+ (5,'make','','\0');
+INSERT INTO `email_actions` VALUES
+ (2,'block'),
+ (5,'copy-to-build-support'),
+ (4,'schedule'),
+ (1,'stabilize'),
+ (3,'unblock');
+INSERT INTO `fail_reasons` VALUES
+ (1,'build()','==> ERROR: A failure occurred in build()\\.',0),
+ (2,'source','==> ERROR: Could not download sources\\.',1),
+ (3,'package-cache','.*error: failed to commit transaction (invalid or corrupted pack',2),
+ (4,'prepare()','==> ERROR: A failure occurred in prepare()\\.',2),
+ (5,'package()','==> ERROR: A failure occurred in package\\(_\\S\\+\\)\\?()\\.',3),
+ (6,'check()','==> ERROR: A failure occurred in check()\\.',4),
+ (7,'dependencies','==> ERROR: \'pacman\' failed to install missing dependencies\\.',1),
+ (8,'run-as-root','==> ERROR: Running makepkg as root is not allowed as it can caus',1),
+ (9,'unknown','.*',100);
+INSERT INTO `git_repositories` VALUES
+ (1,'packages','git://git.archlinux.org/svntogit/packages.git','/home/slave/packages64','7806279e6d3b35afd7be9b49f59b459cef51cb00'),
+ (2,'community','git://git.archlinux.org/svntogit/community.git','/home/slave/community64','5369c9cd66063d9a10ce540d733dfbb285dbcf2b'),
+ (3,'archlinux32','https://github.com/archlinux32/packages.git','/home/slave/packages32','3d5ece893f85808c4b1a63df306e21d5fd97659e');
+INSERT INTO `repositories` VALUES
+ (1,'core',1,'',2),
+ (2,'extra',1,'',2),
+ (3,'community',1,'',2),
+ (4,'build-support',4,'',2),
+ (5,'testing',2,'',2),
+ (6,'community-testing',2,'',2),
+ (7,'staging',3,'',2),
+ (8,'community-staging',3,'',2),
+ (9,'build-list',5,'\0',1),
+ (10,'deletion-list',6,'\0',1),
+ (11,'to-be-decided',7,'\0',1);
+INSERT INTO `repository_moves` VALUES
+ (1,6,3,3),
+ (2,6,3,4),
+ (3,8,6,3),
+ (4,8,6,4),
+ (5,5,1,1),
+ (6,5,2,2),
+ (8,7,5,1),
+ (9,7,5,2),
+ (10,9,7,1),
+ (11,9,7,2),
+ (12,9,8,3),
+ (13,9,8,4);
+INSERT INTO `repository_stabilities` VALUES
+ (1,'stable','Packages: Stable'),
+ (2,'testing','Packages: Testing'),
+ (3,'staging',NULL),
+ (4,'standalone',NULL),
+ (5,'unbuilt','Packages: Build-list'),
+ (6,'forbidden',NULL),
+ (7,'virtual',NULL);
+INSERT INTO `repository_stability_relations` VALUES
+ (16,1,1),
+ (7,1,2),
+ (5,1,3),
+ (24,1,4),
+ (8,1,5),
+ (1,1,6),
+ (17,2,2),
+ (6,2,3),
+ (26,2,4),
+ (10,2,5),
+ (3,2,6),
+ (18,3,3),
+ (25,3,4),
+ (9,3,5),
+ (2,3,6),
+ (23,4,4),
+ (4,5,6);
+INSERT INTO `upstream_repositories` VALUES
+ (4,'community',2),
+ (1,'core',1),
+ (2,'extra',1),
+ (3,'multilib',2);