import kotlin.Int;
import kotlin.String;
import kotlin.collections.List;

ALTER TABLE SavedPost RENAME TO SavedPost_Old;

CREATE TABLE IF NOT EXISTS SavedPost(
  shortId TEXT NOT NULL PRIMARY KEY,
  title TEXT NOT NULL,
  url TEXT NOT NULL,
  createdAt TEXT NOT NULL,
  commentCount INTEGER AS Int,
  commentsUrl TEXT NOT NULL,
  submitterName TEXT NOT NULL,
  tags TEXT AS List<String> NOT NULL,
  description TEXT NOT NULL DEFAULT ""
);

INSERT INTO SavedPost(shortId, title, url, createdAt, commentCount, commentsUrl, submitterName, tags, description)
SELECT shortId, title, url, createdAt, commentCount, commentsUrl, submitterName, tags, description
FROM SavedPost_Old;

DROP TABLE SavedPost_Old;
