SQLite wants INTEGER and not BIGINT for primary keys

This commit is contained in:
Erik Johnston 2015-04-10 11:16:09 +01:00
parent d5d4281647
commit 0f12772e32
6 changed files with 9 additions and 9 deletions

View File

@ -22,7 +22,7 @@ CREATE TABLE IF NOT EXISTS rejections(
-- Push notification endpoints that users have configured
CREATE TABLE IF NOT EXISTS pushers (
id BIGINT PRIMARY KEY AUTOINCREMENT,
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_name VARCHAR(150) NOT NULL,
profile_tag VARCHAR(32) NOT NULL,
kind VARCHAR(8) NOT NULL,
@ -40,7 +40,7 @@ CREATE TABLE IF NOT EXISTS pushers (
);
CREATE TABLE IF NOT EXISTS push_rules (
id BIGINT PRIMARY KEY AUTOINCREMENT,
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_name VARCHAR(150) NOT NULL,
rule_id VARCHAR(150) NOT NULL,
priority_class TINYINT NOT NULL,

View File

@ -14,7 +14,7 @@
*/
CREATE TABLE IF NOT EXISTS application_services(
id BIGINT PRIMARY KEY AUTOINCREMENT,
id INTEGER PRIMARY KEY AUTOINCREMENT,
url VARCHAR(150),
token VARCHAR(150),
hs_token VARCHAR(150),
@ -23,7 +23,7 @@ CREATE TABLE IF NOT EXISTS application_services(
);
CREATE TABLE IF NOT EXISTS application_services_regex(
id BIGINT PRIMARY KEY AUTOINCREMENT,
id INTEGER PRIMARY KEY AUTOINCREMENT,
as_id BIGINT NOT NULL,
namespace INTEGER, /* enum[room_id|room_alias|user_id] */
regex VARCHAR(150),

View File

@ -1,5 +1,5 @@
CREATE TABLE IF NOT EXISTS push_rules_enable (
id BIGINT PRIMARY KEY AUTOINCREMENT,
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_name VARCHAR(150) NOT NULL,
rule_id VARCHAR(150) NOT NULL,
enabled TINYINT,

View File

@ -14,7 +14,7 @@
*/
CREATE TABLE IF NOT EXISTS events(
stream_ordering BIGINT PRIMARY KEY AUTOINCREMENT,
stream_ordering INTEGER PRIMARY KEY AUTOINCREMENT,
topological_ordering BIGINT NOT NULL,
event_id VARCHAR(150) NOT NULL,
type VARCHAR(150) NOT NULL,

View File

@ -29,7 +29,7 @@ CREATE INDEX IF NOT EXISTS transactions_have_ref ON received_transactions(origin
-- Stores what transactions we've sent, what their response was (if we got one) and whether we have
-- since referenced the transaction in another outgoing transaction
CREATE TABLE IF NOT EXISTS sent_transactions(
id BIGINT PRIMARY KEY AUTOINCREMENT, -- This is used to apply insertion ordering
id INTEGER PRIMARY KEY AUTOINCREMENT, -- This is used to apply insertion ordering
transaction_id VARCHAR(150),
destination VARCHAR(150),
response_code INTEGER DEFAULT 0,

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
CREATE TABLE IF NOT EXISTS users(
id BIGINT PRIMARY KEY AUTOINCREMENT,
id INTEGER PRIMARY KEY AUTOINCREMENT,
name VARCHAR(150),
password_hash VARCHAR(150),
creation_ts BIGINT,
@ -22,7 +22,7 @@ CREATE TABLE IF NOT EXISTS users(
);
CREATE TABLE IF NOT EXISTS access_tokens(
id BIGINT PRIMARY KEY AUTOINCREMENT,
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id VARCHAR(150) NOT NULL,
device_id VARCHAR(150),
token VARCHAR(150) NOT NULL,