2015-03-25 13:06:22 -06:00
|
|
|
-- Drop, copy & recreate pushers table to change unique key
|
|
|
|
-- Also add access_token column at the same time
|
|
|
|
CREATE TABLE IF NOT EXISTS pushers2 (
|
2015-12-02 10:19:11 -07:00
|
|
|
id BIGINT PRIMARY KEY,
|
2015-03-25 13:06:22 -06:00
|
|
|
user_name TEXT NOT NULL,
|
2015-12-02 10:23:52 -07:00
|
|
|
access_token BIGINT DEFAULT NULL,
|
|
|
|
profile_tag VARCHAR(32) NOT NULL,
|
|
|
|
kind VARCHAR(8) NOT NULL,
|
|
|
|
app_id VARCHAR(64) NOT NULL,
|
|
|
|
app_display_name VARCHAR(64) NOT NULL,
|
|
|
|
device_display_name VARCHAR(128) NOT NULL,
|
|
|
|
pushkey bytea NOT NULL,
|
2015-03-25 13:06:22 -06:00
|
|
|
ts BIGINT NOT NULL,
|
2015-12-02 10:23:52 -07:00
|
|
|
lang VARCHAR(8),
|
|
|
|
data bytea,
|
2015-03-25 13:06:22 -06:00
|
|
|
last_token TEXT,
|
|
|
|
last_success BIGINT,
|
|
|
|
failing_since BIGINT,
|
2015-12-02 10:23:52 -07:00
|
|
|
UNIQUE (app_id, pushkey)
|
2015-03-25 13:06:22 -06:00
|
|
|
);
|
|
|
|
INSERT INTO pushers2 (id, user_name, profile_tag, kind, app_id, app_display_name, device_display_name, pushkey, ts, lang, data, last_token, last_success, failing_since)
|
|
|
|
SELECT id, user_name, profile_tag, kind, app_id, app_display_name, device_display_name, pushkey, ts, lang, data, last_token, last_success, failing_since FROM pushers;
|
|
|
|
DROP TABLE pushers;
|
|
|
|
ALTER TABLE pushers2 RENAME TO pushers;
|