[epiphany/history-rewrite] ephy-history-service: Make visits.url a foreign key on urls.id
- From: Claudio Saavedra <csaavedra src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/history-rewrite] ephy-history-service: Make visits.url a foreign key on urls.id
- Date: Thu, 21 Jul 2011 09:38:46 +0000 (UTC)
commit a425f41569cdc4aa85bf057a06fbe0f08645d9d6
Author: Claudio Saavedra <csaavedra igalia com>
Date: Thu Jul 21 12:26:41 2011 +0300
ephy-history-service: Make visits.url a foreign key on urls.id
Also, make it cascade deletable. This way, when a user removes a url
from the history, all visits to that url will be removed as well.
lib/history/ephy-history-service-visits-table.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/lib/history/ephy-history-service-visits-table.c b/lib/history/ephy-history-service-visits-table.c
index 04aef43..748a5bd 100644
--- a/lib/history/ephy-history-service-visits-table.c
+++ b/lib/history/ephy-history-service-visits-table.c
@@ -33,7 +33,7 @@ ephy_history_service_initialize_visits_table (EphyHistoryService *self)
ephy_sqlite_connection_execute (priv->history_database,
"CREATE TABLE visits ("
"id INTEGER PRIMARY KEY,"
- "url INTEGER NOT NULL,"
+ "url INTEGER NOT NULL REFERENCES urls(id) ON DELETE CASCADE,"
"visit_time INTEGER NOT NULL,"
"visit_type INTEGER NOT NULL,"
"referring_visit INTEGER)", &error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]