toolkit/components/places/nsPlacesTables.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
michael@0 2 * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
michael@0 3 * This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 #ifndef __nsPlacesTables_h__
michael@0 8 #define __nsPlacesTables_h__
michael@0 9
michael@0 10
michael@0 11 #define CREATE_MOZ_PLACES NS_LITERAL_CSTRING( \
michael@0 12 "CREATE TABLE moz_places ( " \
michael@0 13 " id INTEGER PRIMARY KEY" \
michael@0 14 ", url LONGVARCHAR" \
michael@0 15 ", title LONGVARCHAR" \
michael@0 16 ", rev_host LONGVARCHAR" \
michael@0 17 ", visit_count INTEGER DEFAULT 0" \
michael@0 18 ", hidden INTEGER DEFAULT 0 NOT NULL" \
michael@0 19 ", typed INTEGER DEFAULT 0 NOT NULL" \
michael@0 20 ", favicon_id INTEGER" \
michael@0 21 ", frecency INTEGER DEFAULT -1 NOT NULL" \
michael@0 22 ", last_visit_date INTEGER " \
michael@0 23 ", guid TEXT" \
michael@0 24 ")" \
michael@0 25 )
michael@0 26 #define MOZ_PLACES_COLUMNS \
michael@0 27 "id, url, title, rev_host, visit_count, hidden, typed, favicon_id, " \
michael@0 28 "frecency, last_visit_date"
michael@0 29
michael@0 30 #define CREATE_MOZ_HISTORYVISITS NS_LITERAL_CSTRING( \
michael@0 31 "CREATE TABLE moz_historyvisits (" \
michael@0 32 " id INTEGER PRIMARY KEY" \
michael@0 33 ", from_visit INTEGER" \
michael@0 34 ", place_id INTEGER" \
michael@0 35 ", visit_date INTEGER" \
michael@0 36 ", visit_type INTEGER" \
michael@0 37 ", session INTEGER" \
michael@0 38 ")" \
michael@0 39 )
michael@0 40 #define MOZ_HISTORYVISITS_COLUMNS \
michael@0 41 "id, from_visit, place_id, visit_date, visit_type, session"
michael@0 42
michael@0 43
michael@0 44 #define CREATE_MOZ_INPUTHISTORY NS_LITERAL_CSTRING( \
michael@0 45 "CREATE TABLE moz_inputhistory (" \
michael@0 46 " place_id INTEGER NOT NULL" \
michael@0 47 ", input LONGVARCHAR NOT NULL" \
michael@0 48 ", use_count INTEGER" \
michael@0 49 ", PRIMARY KEY (place_id, input)" \
michael@0 50 ")" \
michael@0 51 )
michael@0 52
michael@0 53 #define CREATE_MOZ_ANNOS NS_LITERAL_CSTRING( \
michael@0 54 "CREATE TABLE moz_annos (" \
michael@0 55 " id INTEGER PRIMARY KEY" \
michael@0 56 ", place_id INTEGER NOT NULL" \
michael@0 57 ", anno_attribute_id INTEGER" \
michael@0 58 ", mime_type VARCHAR(32) DEFAULT NULL" \
michael@0 59 ", content LONGVARCHAR" \
michael@0 60 ", flags INTEGER DEFAULT 0" \
michael@0 61 ", expiration INTEGER DEFAULT 0" \
michael@0 62 ", type INTEGER DEFAULT 0" \
michael@0 63 ", dateAdded INTEGER DEFAULT 0" \
michael@0 64 ", lastModified INTEGER DEFAULT 0" \
michael@0 65 ")" \
michael@0 66 )
michael@0 67
michael@0 68 #define CREATE_MOZ_ANNO_ATTRIBUTES NS_LITERAL_CSTRING( \
michael@0 69 "CREATE TABLE moz_anno_attributes (" \
michael@0 70 " id INTEGER PRIMARY KEY" \
michael@0 71 ", name VARCHAR(32) UNIQUE NOT NULL" \
michael@0 72 ")" \
michael@0 73 )
michael@0 74
michael@0 75 #define CREATE_MOZ_ITEMS_ANNOS NS_LITERAL_CSTRING( \
michael@0 76 "CREATE TABLE moz_items_annos (" \
michael@0 77 " id INTEGER PRIMARY KEY" \
michael@0 78 ", item_id INTEGER NOT NULL" \
michael@0 79 ", anno_attribute_id INTEGER" \
michael@0 80 ", mime_type VARCHAR(32) DEFAULT NULL" \
michael@0 81 ", content LONGVARCHAR" \
michael@0 82 ", flags INTEGER DEFAULT 0" \
michael@0 83 ", expiration INTEGER DEFAULT 0" \
michael@0 84 ", type INTEGER DEFAULT 0" \
michael@0 85 ", dateAdded INTEGER DEFAULT 0" \
michael@0 86 ", lastModified INTEGER DEFAULT 0" \
michael@0 87 ")" \
michael@0 88 )
michael@0 89
michael@0 90 #define CREATE_MOZ_FAVICONS NS_LITERAL_CSTRING( \
michael@0 91 "CREATE TABLE moz_favicons (" \
michael@0 92 " id INTEGER PRIMARY KEY" \
michael@0 93 ", url LONGVARCHAR UNIQUE" \
michael@0 94 ", data BLOB" \
michael@0 95 ", mime_type VARCHAR(32)" \
michael@0 96 ", expiration LONG" \
michael@0 97 ", guid TEXT" \
michael@0 98 ")" \
michael@0 99 )
michael@0 100
michael@0 101 #define CREATE_MOZ_BOOKMARKS NS_LITERAL_CSTRING( \
michael@0 102 "CREATE TABLE moz_bookmarks (" \
michael@0 103 " id INTEGER PRIMARY KEY" \
michael@0 104 ", type INTEGER" \
michael@0 105 ", fk INTEGER DEFAULT NULL" /* place_id */ \
michael@0 106 ", parent INTEGER" \
michael@0 107 ", position INTEGER" \
michael@0 108 ", title LONGVARCHAR" \
michael@0 109 ", keyword_id INTEGER" \
michael@0 110 ", folder_type TEXT" \
michael@0 111 ", dateAdded INTEGER" \
michael@0 112 ", lastModified INTEGER" \
michael@0 113 ", guid TEXT" \
michael@0 114 ")" \
michael@0 115 )
michael@0 116
michael@0 117 #define CREATE_MOZ_BOOKMARKS_ROOTS NS_LITERAL_CSTRING( \
michael@0 118 "CREATE TABLE moz_bookmarks_roots (" \
michael@0 119 " root_name VARCHAR(16) UNIQUE" \
michael@0 120 ", folder_id INTEGER" \
michael@0 121 ")" \
michael@0 122 )
michael@0 123
michael@0 124 #define CREATE_MOZ_KEYWORDS NS_LITERAL_CSTRING( \
michael@0 125 "CREATE TABLE moz_keywords (" \
michael@0 126 " id INTEGER PRIMARY KEY AUTOINCREMENT" \
michael@0 127 ", keyword TEXT UNIQUE" \
michael@0 128 ")" \
michael@0 129 )
michael@0 130
michael@0 131 #define CREATE_MOZ_HOSTS NS_LITERAL_CSTRING( \
michael@0 132 "CREATE TABLE moz_hosts (" \
michael@0 133 " id INTEGER PRIMARY KEY" \
michael@0 134 ", host TEXT NOT NULL UNIQUE" \
michael@0 135 ", frecency INTEGER" \
michael@0 136 ", typed INTEGER NOT NULL DEFAULT 0" \
michael@0 137 ", prefix TEXT" \
michael@0 138 ")" \
michael@0 139 )
michael@0 140
michael@0 141 // Note: this should be kept up-to-date with the definition in
michael@0 142 // nsPlacesAutoComplete.js.
michael@0 143 #define CREATE_MOZ_OPENPAGES_TEMP NS_LITERAL_CSTRING( \
michael@0 144 "CREATE TEMP TABLE moz_openpages_temp (" \
michael@0 145 " url TEXT PRIMARY KEY" \
michael@0 146 ", open_count INTEGER" \
michael@0 147 ")" \
michael@0 148 )
michael@0 149
michael@0 150 #endif // __nsPlacesTables_h__

mercurial