Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Implement local db upgrade.
Vsevolod Stakhov committed 12 years ago
commit eccb058023f2cd2e2cf9e3f9a1c56bb813212504
parent 9caac79
2 files changed +11 -2
modified libpkg/pkgdb.c
@@ -7,6 +7,7 @@
 * Copyright (c) 2012-2013 Matthew Seaman <matthew@FreeBSD.org>
 * Copyright (c) 2012 Bryan Drewery <bryan@shatow.net>
 * Copyright (c) 2013 Gerald Pfeifer <gerald@pfeifer.com>
+
 * Copyright (c) 2013-2014 Vsevolod Stakhov <vsevolod@FreeBSD.org>
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
@@ -72,7 +73,7 @@
*/

#define DB_SCHEMA_MAJOR	0
-
#define DB_SCHEMA_MINOR	22
+
#define DB_SCHEMA_MINOR	23

#define DBVERSION (DB_SCHEMA_MAJOR * 1000 + DB_SCHEMA_MINOR)

@@ -630,6 +631,10 @@ pkgdb_init(sqlite3 *sdb)
	    "UNIQUE(package_id, provide_id)"
	");"

+
	/* FTS search table */
+

+
	"CREATE VIRTUAL TABLE pkg_search USING fts4(id, name, origin);"
+

	/* Mark the end of the array */

	"CREATE INDEX deporigini on deps(origin);"
modified libpkg/private/db_upgrades.h
@@ -2,7 +2,7 @@
 * Copyright (c) 2011-2012 Baptiste Daroussin <bapt@FreeBSD.org>
 * Copyright (c) 2011-2012 Julien Laffaye <jlaffaye@FreeBSD.org>
 * Copyright (c) 2013 Matthew Seaman <matthew@FreeBSD.org>
-
 * Copyright (c) 2013 Vsevolod Stakhov <vsevolod@FreeBSD.org>
+
 * Copyright (c) 2013-2014 Vsevolod Stakhov <vsevolod@FreeBSD.org>
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without
@@ -555,6 +555,10 @@ static struct db_upgrades {
	    "UNIQUE(package_id, provide_id)"
	");"
	},
+
	{23,
+
	"CREATE VIRTUAL TABLE pkg_search USING fts4(id, name, origin);"
+
	"INSERT INTO pkg_search SELECT id, name, origin FROM packages;"
+
	},


	/* Mark the end of the array */