Skip to content

Commit daad593

Browse files
author
Stephen Romansky
committed
Added outline of new database scheme and TODO list to implement it
Related Freeseer#667 Related Freeseer#484 Related Freeseer#671
1 parent 145f7f9 commit daad593

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

src/freeseer/framework/database.py

+32
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
Time timestamp,
5050
UNIQUE (Speaker, Title) ON CONFLICT IGNORE)'''
5151

52+
# The SQLITE timestamp field corresponds to the DateTime object. The Date column in the database can be created from
53+
# a DateTime.date() call.
5254
PRESENTATIONS_SCHEMA_310 = '''CREATE TABLE IF NOT EXISTS presentations
5355
(Id INTEGER PRIMARY KEY,
5456
Title varchar(255),
@@ -62,13 +64,43 @@
6264
EndTime timestamp,
6365
UNIQUE (Speaker, Title) ON CONFLICT IGNORE)'''
6466

67+
# TODO: Make PRESENTATIONS_SCHEMA_315 the default schema when the presentation table is created
68+
# TODO: Make an upgrade method from PRESENTATIONS_SCHEMA_310 to PRESENTATIONS_SCHEMA_315
69+
# TODO: Update the SCHEMA_VERSION to 315
70+
# TODO: Integrate new database scheme with importers/exporter functions
71+
# TODO: Force Presentation.Date to be a QDate
72+
# TODO: Figure out what the types should be for Presentation.StartTime/EndTime e.g. QTime
73+
# TODO: Enforce the default database values in the CSV/RSS importer
74+
# TODO: Enforce the default database values in Presentation.__init__
75+
# TODO: Enforce the default database values in db.insert_presentation()
76+
# TODO: Check what format the csv and rss sample files are in. For instance, do the rss files use 'None' instead of ''
77+
# for missing fields?
78+
# TODO: Update _helper_presentation_exists() and get_presentation_id() to use the new schema such that they no longer
79+
# check if the stored data values are NULL
80+
PRESENTATIONS_SCHEMA_315 = '''CREATE TABLE IF NOT EXISTS presentations
81+
(Id INTEGER PRIMARY KEY,
82+
Title varchar(255) NOT NULL DEFAULT '',
83+
Speaker varchar(100) NOT NULL DEFAULT '',
84+
Description text NOT NULL DEFAULT '',
85+
Category varchar(25) NOT NULL DEFAULT '',
86+
Event varchar(100) NOT NULL DEFAULT '',
87+
Room varchar(25) NOT NULL DEFAULT '',
88+
Date timestamp NOT NULL DEFAULT '',
89+
StartTime timestamp NOT NULL DEFAULT '',
90+
EndTime timestamp NOT NULL DEFAULT '',
91+
UNIQUE (Speaker, Title, Event) ON CONFLICT IGNORE)'''
92+
6593
REPORTS_SCHEMA_300 = '''CREATE TABLE IF NOT EXISTS failures
6694
(Id INTERGER PRIMARY KEY,
6795
Comments TEXT,
6896
Indicator TEXT,
6997
Release INTEGER,
7098
UNIQUE (ID) ON CONFLICT REPLACE)'''
7199

100+
# TODO: Ensure that the CSV/RSS to presentation importers are done using the same conventions. For instance, convert a
101+
# room with value None to '' in both the csv and rss importer. Instead of the csv parser converting None to 'None'
102+
# and the rss importer doing something else etcetera.
103+
72104

73105
class QtDBConnector(object):
74106
def __init__(self, db_filepath, plugman):

0 commit comments

Comments
 (0)