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

25 lines
525 B
Python

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