private void DropCreateTestTables()
        {
            string propertyTableSql = ""
                                      + "CREATE TABLE Property (Id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, Name text, Address text)";

            _db.TryDropTable("Property");
            _db.TransactDDL(propertyTableSql);

            string BuildingTableSql = ""
                                      + "CREATE TABLE Building ( BIN text PRIMARY KEY NOT NULL, Identifier text, PropertyId int )";

            _db.TryDropTable("Building");
            if (!_db.TableExists("Building"))
            {
                _db.TransactDDL(BuildingTableSql);
            }

            string UnitTableSql = ""
                                  + "CREATE TABLE unit ( unit_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, BIN TEXT, unit_no TEXT )";

            _db.TryDropTable("unit");
            _db.TransactDDL(UnitTableSql);

            string WorkOrderTableSql = ""
                                       + "CREATE TABLE wk_order ( wo_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, desc text)";

            _db.TryDropTable("wk_order");
            _db.TransactDDL(WorkOrderTableSql);
        }
Exemple #2
0
        private void DropCreateTestTables()
        {
            string UnitTableSql = ""
                                  + "CREATE TABLE unit ( unit_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, BIN TEXT, unit_no TEXT )";

            _db.TryDropTable("unit");
            _db.TransactDDL(UnitTableSql);
        }
Exemple #3
0
        private void DropCreateTestTables()
        {
            string propertyTableSql = ""
                                      + "CREATE TABLE Property (Id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, Name text, Address text)";

            _db.TryDropTable("Property");
            _db.TransactDDL(propertyTableSql);
        }
        private void DropCreateTestTables()
        {
            string WorkOrderTableSql = ""
                                       + "CREATE TABLE wk_order ( wo_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, \"desc\" text)";

            _db.TryDropTable("wk_order");
            _db.TransactDDL(WorkOrderTableSql);
        }
Exemple #5
0
        private void DropCreateTestTables()
        {
            string BuildingTableSql = ""
                                      + "CREATE TABLE Building ( BIN text PRIMARY KEY NOT NULL, Identifier text, PropertyId int )";

            _db.TryDropTable("Building");
            if (!_db.TableExists("Building"))
            {
                _db.TransactDDL(BuildingTableSql);
            }
        }
Exemple #6
0
        public override void DropCreateAll(bool forceDropCreateTables)
        {
            if (!forceDropCreateTables)
            {
                return;
            }

            const string urlItemSql =
                @"
CREATE TABLE UrlItem ( 
    Id INTEGER PRIMARY KEY AUTOINCREMENT
    , CustomUrl VARCHAR(1000)
    , OriginUrl VARCHAR(2000) NOT NULL
    , ExpireInDays DOUBLE NOT NULL
    , ExpireMode SMALLINT NOT NULL
    , CreatedOn DATETIME NOT NULL
);";
            const string urlHitSql =
                @"
CREATE TABLE UrlHit (
    Id INTEGER PRIMARY KEY AUTOINCREMENT
    , UrlItemId INTEGER
    , ClientIp VARCHAR(45)
    , HitOn DATETIME NOT NULL
);";

            if (_db.TableExists("UrlItem"))
            {
                _db.TryDropTable("UrlItem");
            }

            if (_db.TableExists("UrlHit"))
            {
                _db.TryDropTable("UrlHit");
            }

            _db.TransactDDL(urlItemSql);
            _db.TransactDDL(urlHitSql);
        }
Exemple #7
0
        public override void DropCreateAll()
        {
            const string SQL_TRACKS_TABLE = ""
                                            + "CREATE TABLE Track ( TrackId INTEGER PRIMARY KEY AUTOINCREMENT, AlbumId INT NOT NULL, Name text NOT NULL, Composer TEXT );";
            const string SQL_ARTISTS_TABLE = ""
                                             + "CREATE TABLE Artist ( ArtistId INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, Name TEXT NOT NULL );";
            const string SQL_ALBUMS_TABLE = ""
                                            + "CREATE TABLE Album ( AlbumId INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, ArtistId INT NOT NULL, Title text NOT NULL );";

            _db.TryDropTable("Artist");
            _db.TryDropTable("Album");
            _db.TryDropTable("Track");
            _db.TryDropTable("artistdocuments");

            int result = _db.TransactDDL(SQL_ARTISTS_TABLE + SQL_ALBUMS_TABLE + SQL_TRACKS_TABLE);
        }