Skip to content

Commit

Permalink
update name
Browse files Browse the repository at this point in the history
  • Loading branch information
Monirzadeh committed Apr 27, 2024
1 parent 1a908d0 commit a7a70a7
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
-- Create a temporary table
CREATE TABLE IF NOT EXISTS bookmark_temp(
id INTEGER PRIMARY KEY AUTOINCREMENT,
url TEXT NOT NULL,
Expand All @@ -8,15 +7,12 @@ CREATE TABLE IF NOT EXISTS bookmark_temp(
public INTEGER NOT NULL DEFAULT 0,
modified TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
has_content BOOLEAN DEFAULT FALSE NOT NULL,
CONSTRAINT bookmark_url_UNIQUE UNIQUE(url)
CONSTRAINT bookmark_new_url_UNIQUE UNIQUE(url)
);

-- Copy data from the original table to the temporary table
INSERT INTO bookmark_temp (id, url, title, excerpt, author, public, modified, has_content)
INSERT INTO bookmark_new(id, url, title, excerpt, author, public, modified, has_content)
SELECT id, url, title, excerpt, author, public, modified, has_content FROM bookmark;

-- Drop the original table
DROP TABLE bookmark;

-- Rename the temporary table to the original table name
ALTER TABLE bookmark_temp RENAME TO bookmark;

0 comments on commit a7a70a7

Please sign in to comment.