You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
stacosys/dbmigration/create_empty_db.py

24 lines
502 B
Python

#!/usr/bin/python
# -*- coding: UTF-8 -*-
import sqlite3
connection = sqlite3.connect("db.sqlite")
cursor = connection.cursor()
script = """
CREATE TABLE comment (
id INTEGER NOT NULL PRIMARY KEY,
url VARCHAR(255) NOT NULL,
notified DATETIME,
created DATETIME NOT NULL,
published DATETIME,
author_name VARCHAR(255) NOT NULL,
author_site VARCHAR(255) NOT NULL,
author_gravatar varchar(255),
content TEXT NOT NULL
, ulid INTEGER);
"""
cursor.executescript(script)
connection.close()