remove email column

This commit is contained in:
Martin Zimmermann 2013-09-06 15:56:43 +02:00
parent 59706815e7
commit 11c6e4d720
2 changed files with 8 additions and 3 deletions

View File

@ -76,7 +76,7 @@ class SQLite(Abstract):
fields = [ fields = [
'path', 'id', 'created', 'modified', 'path', 'id', 'created', 'modified',
'text', 'author', 'email', 'website', 'parent', 'mode' 'text', 'author', 'hash', 'website', 'parent', 'mode'
] ]
def __init__(self, dbpath, moderation): def __init__(self, dbpath, moderation):
@ -87,8 +87,9 @@ class SQLite(Abstract):
with sqlite3.connect(self.dbpath) as con: with sqlite3.connect(self.dbpath) as con:
sql = ('main.comments (path VARCHAR(255) NOT NULL, id INTEGER NOT NULL,' sql = ('main.comments (path VARCHAR(255) NOT NULL, id INTEGER NOT NULL,'
'created FLOAT NOT NULL, modified FLOAT, text VARCHAR,' 'created FLOAT NOT NULL, modified FLOAT, text VARCHAR,'
'author VARCHAR(64), email VARCHAR(64), website VARCHAR(64),' 'author VARCHAR(64), hash VARCHAR(32), website VARCHAR(64),'
'parent INTEGER, mode INTEGER, hash CHAR(32), PRIMARY KEY (id, path))') 'parent INTEGER, mode INTEGER,'
'PRIMARY KEY (id, path))')
con.execute("CREATE TABLE IF NOT EXISTS %s;" % sql) con.execute("CREATE TABLE IF NOT EXISTS %s;" % sql)
# increment id if (id, path) is no longer unique # increment id if (id, path) is no longer unique

View File

@ -1,4 +1,5 @@
import os
import json import json
import urllib import urllib
import tempfile import tempfile
@ -35,6 +36,9 @@ class TestComments(unittest.TestCase):
self.post = self.client.post self.post = self.client.post
self.delete = self.client.delete self.delete = self.client.delete
def tearDown(self):
os.unlink(self.path)
def testGet(self): def testGet(self):
self.post('/new?uri=%2Fpath%2F', data=json.dumps({'text': 'Lorem ipsum ...'})) self.post('/new?uri=%2Fpath%2F', data=json.dumps({'text': 'Lorem ipsum ...'}))