CREATE TABLE tags2 (
    id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
    tag TEXT NOT NULL DEFAULT '',
    is_hashtag BOOLEAN NOT NULL DEFAULT 'f',
    post_id INTEGER REFERENCES posts(id) ON DELETE CASCADE NOT NULL
);

INSERT INTO tags2 SELECT * FROM tags;
DROP TABLE tags;
ALTER TABLE tags2 RENAME TO tags;
