From 07cc1fdc7e79468a6e8d9b53048712b652f8da84 Mon Sep 17 00:00:00 2001 From: neodarz Date: Sun, 13 Jan 2019 18:34:54 +0100 Subject: Migrate to PostgreSQL --- database/models.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'database/models.py') diff --git a/database/models.py b/database/models.py index c731a08..2f9528a 100644 --- a/database/models.py +++ b/database/models.py @@ -1,9 +1,8 @@ -from peewee import Model, CharField, SqliteDatabase +from peewee import Model, CharField, TextField, PostgresqlDatabase import config -db = SqliteDatabase(config.DATABASE) -db.connect() +db = PostgresqlDatabase(config.DB, host=config.DB_HOST, port=config.DB_PORT, user=config.DB_USER, password=config.DB_PASS, autocommit=True, autorollback=True) class Page(Model): """ @@ -11,7 +10,7 @@ class Page(Model): """ url = CharField() title = CharField(null=True) - content = CharField(null=True) + content = TextField(null=True) class Meta: database = db -- cgit v1.2.1