So I tried importing this into sqlite
-- Create the users table
CREATE TABLE users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
username text NOT NULL,
email text NOT NULL,
bio text NOT NULL,
website text NOT NULL,
password text NOT NULL,
karma text NOT NULL,
upvotes text NOT NULL,
comments text NOT NULL,
role text NOT NULL
);
-- Create the posts table
CREATE TABLE posts (
id INTEGER PRIMARY KEY AUTOINCREMENT,
userid text NOT NULL,
date text NOT NULL,
lastEdited text NOT NULL,
title text NOT NULL,
body text NOT NULL,
url text NOT NULL,
tags text NOT NULL,
locked text NOT NULL,
hidden text NOT NULL,
upvotes text NOT NULL,
);
-- Create the comments table
CREATE TABLE comments (
id INTEGER PRIMARY KEY AUTOINCREMENT,
inReplyTo text NOT NULL,
userid text NOT NULL,
date text NOT NULL,
lastEdited text NOT NULL,
body text NOT NULL,
upvotes text NOT NULL,
);
-- Settings
CREATE TABLE settings (
key text NOT NULL,
value text NOT NULL
);
Running cat init.sql | sqlite3 database.sqlite
shows this error:
Error: near line 15: near ")": syntax error
Error: near line 29: near ")": syntax error
Error: near line 50: no such table: posts
Using mysql2sqlite gives me this error:
Error: near line 4: near ",": syntax error
Error: near line 45: no such table: users
Error: near line 46: NOT NULL constraint failed: posts.lastEdited
What mistake did I make in the SQL statements?