Skip to content

Commit

Permalink
Created table that will hold last index for processed files.
Browse files Browse the repository at this point in the history
  • Loading branch information
grigoryvp committed Mar 2, 2012
1 parent 8e06ff4 commit 878bdcc
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,17 @@
import uuid
from common import *

SQL_CREATE = """CREATE TABLE IF NOT EXISTS task (
guid TEXT,
name TEXT UNIQUE,
src TEXT,
dst TEXT)"""
SQL_CREATE = """
CREATE TABLE IF NOT EXISTS task (
guid TEXT UNIQUE,
name TEXT UNIQUE,
src TEXT,
dst TEXT);
CREATE TABLE IF NOT EXISTS index_last (
guid TEXT,
name TEXT,
index_last INTEGER);
"""
SQL_TASK_ADD = """INSERT INTO task (guid, name, src, dst)
VALUES (:guid, :name, :src, :dst)"""
SQL_TASK_LIST = """SELECT * FROM task"""
Expand All @@ -29,7 +35,7 @@ def init( self, notify = False ) :
self.m_fNotify = notify
self.m_fInit = True
with sqlite3.connect( FILE_CFG ) as oConn :
oConn.execute( SQL_CREATE )
oConn.executescript( SQL_CREATE )

## Notify daemon process so it can read updated settings.
@classmethod
Expand Down

0 comments on commit 878bdcc

Please sign in to comment.