align types between sqlite & postgres
this one's achieved by adding "NOT NULL" at the *correct* position in SQLite's create tables.
This commit is contained in:
parent
b28bef20a7
commit
88456faf84
@ -1,6 +1,6 @@
|
|||||||
-- Your SQL goes here
|
-- Your SQL goes here
|
||||||
CREATE TABLE instances (
|
CREATE TABLE instances (
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||||
public_domain VARCHAR NOT NULL,
|
public_domain VARCHAR NOT NULL,
|
||||||
name VARCHAR NOT NULL,
|
name VARCHAR NOT NULL,
|
||||||
local BOOLEAN NOT NULL DEFAULT 'f',
|
local BOOLEAN NOT NULL DEFAULT 'f',
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
-- Your SQL goes here
|
-- Your SQL goes here
|
||||||
PRAGMA foreign_keys = ON;
|
PRAGMA foreign_keys = ON;
|
||||||
CREATE TABLE users (
|
CREATE TABLE users (
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||||
username VARCHAR NOT NULL,
|
username VARCHAR NOT NULL,
|
||||||
display_name VARCHAR NOT NULL DEFAULT '',
|
display_name VARCHAR NOT NULL DEFAULT '',
|
||||||
outbox_url VARCHAR NOT NULL,
|
outbox_url VARCHAR NOT NULL,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
-- Your SQL goes here
|
-- Your SQL goes here
|
||||||
CREATE TABLE blogs (
|
CREATE TABLE blogs (
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||||
actor_id VARCHAR NOT NULL,
|
actor_id VARCHAR NOT NULL,
|
||||||
title VARCHAR NOT NULL,
|
title VARCHAR NOT NULL,
|
||||||
summary TEXT NOT NULL DEFAULT '',
|
summary TEXT NOT NULL DEFAULT '',
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
-- Your SQL goes here
|
-- Your SQL goes here
|
||||||
CREATE TABLE blog_authors (
|
CREATE TABLE blog_authors (
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||||
blog_id INTEGER REFERENCES blogs(id) ON DELETE CASCADE NOT NULL,
|
blog_id INTEGER REFERENCES blogs(id) ON DELETE CASCADE NOT NULL,
|
||||||
author_id INTEGER REFERENCES users(id) ON DELETE CASCADE NOT NULL,
|
author_id INTEGER REFERENCES users(id) ON DELETE CASCADE NOT NULL,
|
||||||
is_owner BOOLEAN NOT NULL DEFAULT 'f'
|
is_owner BOOLEAN NOT NULL DEFAULT 'f'
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
-- Your SQL goes here
|
-- Your SQL goes here
|
||||||
CREATE TABLE posts (
|
CREATE TABLE posts (
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||||
blog_id INTEGER REFERENCES blogs(id) ON DELETE CASCADE NOT NULL,
|
blog_id INTEGER REFERENCES blogs(id) ON DELETE CASCADE NOT NULL,
|
||||||
slug VARCHAR NOT NULL,
|
slug VARCHAR NOT NULL,
|
||||||
title VARCHAR NOT NULL,
|
title VARCHAR NOT NULL,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
-- Your SQL goes here
|
-- Your SQL goes here
|
||||||
CREATE TABLE post_authors (
|
CREATE TABLE post_authors (
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||||
post_id INTEGER REFERENCES posts(id) ON DELETE CASCADE NOT NULL,
|
post_id INTEGER REFERENCES posts(id) ON DELETE CASCADE NOT NULL,
|
||||||
author_id INTEGER REFERENCES users(id) ON DELETE CASCADE NOT NULL
|
author_id INTEGER REFERENCES users(id) ON DELETE CASCADE NOT NULL
|
||||||
)
|
)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
-- Your SQL goes here
|
-- Your SQL goes here
|
||||||
CREATE TABLE follows (
|
CREATE TABLE follows (
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||||
follower_id INTEGER REFERENCES users(id) ON DELETE CASCADE NOT NULL,
|
follower_id INTEGER REFERENCES users(id) ON DELETE CASCADE NOT NULL,
|
||||||
following_id INTEGER REFERENCES users(id) ON DELETE CASCADE NOT NULL,
|
following_id INTEGER REFERENCES users(id) ON DELETE CASCADE NOT NULL,
|
||||||
ap_url TEXT NOT NULL default ''
|
ap_url TEXT NOT NULL default ''
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
-- Your SQL goes here
|
-- Your SQL goes here
|
||||||
CREATE TABLE comments (
|
CREATE TABLE comments (
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||||
content TEXT NOT NULL DEFAULT '',
|
content TEXT NOT NULL DEFAULT '',
|
||||||
in_response_to_id INTEGER REFERENCES comments(id),
|
in_response_to_id INTEGER REFERENCES comments(id),
|
||||||
post_id INTEGER REFERENCES posts(id) ON DELETE CASCADE NOT NULL,
|
post_id INTEGER REFERENCES posts(id) ON DELETE CASCADE NOT NULL,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
-- Your SQL goes here
|
-- Your SQL goes here
|
||||||
CREATE TABLE likes (
|
CREATE TABLE likes (
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||||
user_id INTEGER REFERENCES users(id) ON DELETE CASCADE NOT NULL,
|
user_id INTEGER REFERENCES users(id) ON DELETE CASCADE NOT NULL,
|
||||||
post_id INTEGER REFERENCES posts(id) ON DELETE CASCADE NOT NULL,
|
post_id INTEGER REFERENCES posts(id) ON DELETE CASCADE NOT NULL,
|
||||||
ap_url VARCHAR NOT NULL default '',
|
ap_url VARCHAR NOT NULL default '',
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
-- Your SQL goes here
|
-- Your SQL goes here
|
||||||
CREATE TABLE notifications (
|
CREATE TABLE notifications (
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||||
user_id INTEGER REFERENCES users(id) ON DELETE CASCADE NOT NULL,
|
user_id INTEGER REFERENCES users(id) ON DELETE CASCADE NOT NULL,
|
||||||
creation_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
creation_date DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
kind VARCHAR NOT NULL DEFAULT 'unknown',
|
kind VARCHAR NOT NULL DEFAULT 'unknown',
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
-- Your SQL goes here
|
-- Your SQL goes here
|
||||||
CREATE TABLE reshares (
|
CREATE TABLE reshares (
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||||
user_id INTEGER REFERENCES users(id) ON DELETE CASCADE NOT NULL,
|
user_id INTEGER REFERENCES users(id) ON DELETE CASCADE NOT NULL,
|
||||||
post_id INTEGER REFERENCES posts(id) ON DELETE CASCADE NOT NULL,
|
post_id INTEGER REFERENCES posts(id) ON DELETE CASCADE NOT NULL,
|
||||||
ap_url VARCHAR NOT NULL DEFAULT '',
|
ap_url VARCHAR NOT NULL DEFAULT '',
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
-- Your SQL goes here
|
-- Your SQL goes here
|
||||||
CREATE TABLE mentions (
|
CREATE TABLE mentions (
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||||
mentioned_id INTEGER REFERENCES users(id) ON DELETE CASCADE NOT NULL,
|
mentioned_id INTEGER REFERENCES users(id) ON DELETE CASCADE NOT NULL,
|
||||||
post_id INTEGER REFERENCES posts(id) ON DELETE CASCADE,
|
post_id INTEGER REFERENCES posts(id) ON DELETE CASCADE,
|
||||||
comment_id INTEGER REFERENCES comments(id) ON DELETE CASCADE,
|
comment_id INTEGER REFERENCES comments(id) ON DELETE CASCADE,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
-- Your SQL goes here
|
-- Your SQL goes here
|
||||||
CREATE TABLE medias (
|
CREATE TABLE medias (
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||||
file_path TEXT NOT NULL DEFAULT '',
|
file_path TEXT NOT NULL DEFAULT '',
|
||||||
alt_text TEXT NOT NULL DEFAULT '',
|
alt_text TEXT NOT NULL DEFAULT '',
|
||||||
is_remote BOOLEAN NOT NULL DEFAULT 'f',
|
is_remote BOOLEAN NOT NULL DEFAULT 'f',
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
-- Your SQL goes here
|
-- Your SQL goes here
|
||||||
CREATE TABLE tags (
|
CREATE TABLE tags (
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||||
tag TEXT NOT NULL DEFAULT '',
|
tag TEXT NOT NULL DEFAULT '',
|
||||||
is_hastag BOOLEAN NOT NULL DEFAULT 'f',
|
is_hastag BOOLEAN NOT NULL DEFAULT 'f',
|
||||||
post_id INTEGER REFERENCES posts(id) ON DELETE CASCADE NOT NULL
|
post_id INTEGER REFERENCES posts(id) ON DELETE CASCADE NOT NULL
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
table! {
|
table! {
|
||||||
blog_authors (id) {
|
blog_authors (id) {
|
||||||
id -> Nullable<Integer>,
|
id -> Integer,
|
||||||
blog_id -> Integer,
|
blog_id -> Integer,
|
||||||
author_id -> Integer,
|
author_id -> Integer,
|
||||||
is_owner -> Bool,
|
is_owner -> Bool,
|
||||||
@ -9,7 +9,7 @@ table! {
|
|||||||
|
|
||||||
table! {
|
table! {
|
||||||
blogs (id) {
|
blogs (id) {
|
||||||
id -> Nullable<Integer>,
|
id -> Integer,
|
||||||
actor_id -> Text,
|
actor_id -> Text,
|
||||||
title -> Text,
|
title -> Text,
|
||||||
summary -> Text,
|
summary -> Text,
|
||||||
@ -25,7 +25,7 @@ table! {
|
|||||||
|
|
||||||
table! {
|
table! {
|
||||||
comments (id) {
|
comments (id) {
|
||||||
id -> Nullable<Integer>,
|
id -> Integer,
|
||||||
content -> Text,
|
content -> Text,
|
||||||
in_response_to_id -> Nullable<Integer>,
|
in_response_to_id -> Nullable<Integer>,
|
||||||
post_id -> Integer,
|
post_id -> Integer,
|
||||||
@ -39,7 +39,7 @@ table! {
|
|||||||
|
|
||||||
table! {
|
table! {
|
||||||
follows (id) {
|
follows (id) {
|
||||||
id -> Nullable<Integer>,
|
id -> Integer,
|
||||||
follower_id -> Integer,
|
follower_id -> Integer,
|
||||||
following_id -> Integer,
|
following_id -> Integer,
|
||||||
ap_url -> Text,
|
ap_url -> Text,
|
||||||
@ -48,7 +48,7 @@ table! {
|
|||||||
|
|
||||||
table! {
|
table! {
|
||||||
instances (id) {
|
instances (id) {
|
||||||
id -> Nullable<Integer>,
|
id -> Integer,
|
||||||
public_domain -> Text,
|
public_domain -> Text,
|
||||||
name -> Text,
|
name -> Text,
|
||||||
local -> Bool,
|
local -> Bool,
|
||||||
@ -65,7 +65,7 @@ table! {
|
|||||||
|
|
||||||
table! {
|
table! {
|
||||||
likes (id) {
|
likes (id) {
|
||||||
id -> Nullable<Integer>,
|
id -> Integer,
|
||||||
user_id -> Integer,
|
user_id -> Integer,
|
||||||
post_id -> Integer,
|
post_id -> Integer,
|
||||||
ap_url -> Text,
|
ap_url -> Text,
|
||||||
@ -75,7 +75,7 @@ table! {
|
|||||||
|
|
||||||
table! {
|
table! {
|
||||||
medias (id) {
|
medias (id) {
|
||||||
id -> Nullable<Integer>,
|
id -> Integer,
|
||||||
file_path -> Text,
|
file_path -> Text,
|
||||||
alt_text -> Text,
|
alt_text -> Text,
|
||||||
is_remote -> Bool,
|
is_remote -> Bool,
|
||||||
@ -88,7 +88,7 @@ table! {
|
|||||||
|
|
||||||
table! {
|
table! {
|
||||||
mentions (id) {
|
mentions (id) {
|
||||||
id -> Nullable<Integer>,
|
id -> Integer,
|
||||||
mentioned_id -> Integer,
|
mentioned_id -> Integer,
|
||||||
post_id -> Nullable<Integer>,
|
post_id -> Nullable<Integer>,
|
||||||
comment_id -> Nullable<Integer>,
|
comment_id -> Nullable<Integer>,
|
||||||
@ -98,7 +98,7 @@ table! {
|
|||||||
|
|
||||||
table! {
|
table! {
|
||||||
notifications (id) {
|
notifications (id) {
|
||||||
id -> Nullable<Integer>,
|
id -> Integer,
|
||||||
user_id -> Integer,
|
user_id -> Integer,
|
||||||
creation_date -> Timestamp,
|
creation_date -> Timestamp,
|
||||||
kind -> Text,
|
kind -> Text,
|
||||||
@ -108,7 +108,7 @@ table! {
|
|||||||
|
|
||||||
table! {
|
table! {
|
||||||
post_authors (id) {
|
post_authors (id) {
|
||||||
id -> Nullable<Integer>,
|
id -> Integer,
|
||||||
post_id -> Integer,
|
post_id -> Integer,
|
||||||
author_id -> Integer,
|
author_id -> Integer,
|
||||||
}
|
}
|
||||||
@ -116,7 +116,7 @@ table! {
|
|||||||
|
|
||||||
table! {
|
table! {
|
||||||
posts (id) {
|
posts (id) {
|
||||||
id -> Nullable<Integer>,
|
id -> Integer,
|
||||||
blog_id -> Integer,
|
blog_id -> Integer,
|
||||||
slug -> Text,
|
slug -> Text,
|
||||||
title -> Text,
|
title -> Text,
|
||||||
@ -132,7 +132,7 @@ table! {
|
|||||||
|
|
||||||
table! {
|
table! {
|
||||||
reshares (id) {
|
reshares (id) {
|
||||||
id -> Nullable<Integer>,
|
id -> Integer,
|
||||||
user_id -> Integer,
|
user_id -> Integer,
|
||||||
post_id -> Integer,
|
post_id -> Integer,
|
||||||
ap_url -> Text,
|
ap_url -> Text,
|
||||||
@ -142,7 +142,7 @@ table! {
|
|||||||
|
|
||||||
table! {
|
table! {
|
||||||
tags (id) {
|
tags (id) {
|
||||||
id -> Nullable<Integer>,
|
id -> Integer,
|
||||||
tag -> Text,
|
tag -> Text,
|
||||||
is_hastag -> Bool,
|
is_hastag -> Bool,
|
||||||
post_id -> Integer,
|
post_id -> Integer,
|
||||||
@ -151,7 +151,7 @@ table! {
|
|||||||
|
|
||||||
table! {
|
table! {
|
||||||
users (id) {
|
users (id) {
|
||||||
id -> Nullable<Integer>,
|
id -> Integer,
|
||||||
username -> Text,
|
username -> Text,
|
||||||
display_name -> Text,
|
display_name -> Text,
|
||||||
outbox_url -> Text,
|
outbox_url -> Text,
|
||||||
|
Loading…
Reference in New Issue
Block a user