All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sql.migration.V20160205215901__AddArchivedAtToDialogs.sql Maven / Gradle / Ivy

The newest version!
ALTER TABLE user_dialogs ADD COLUMN archived_at TIMESTAMP DEFAULT NULL;
ALTER TABLE user_dialogs DROP COLUMN is_archived;
CREATE INDEX ON user_dialogs(user_id, archived_at);
UPDATE user_dialogs SET archived_at = (
  CASE shown_at
    WHEN NULL THEN NOW() + ((RANDOM()*1000)::INT::TEXT || ' seconds')::INTERVAL
    ELSE NULL
  END
);




© 2015 - 2024 Weber Informatics LLC | Privacy Policy