Пример #1
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);

            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);
        }
Пример #2
0
        public void Creates_table_with_string_id()
        {
            // The Guitar test object has a string field named simply SKU. This will not be matched
            // without an attribute decoration, and horrible plague and pesilence will result.

            _db.TryDropTable("guitardocuments");
            var  guitarstore = new SqliteDocumentStore <GuitarDocuments>(_db);
            bool exists      = _db.TableExists(guitarstore.TableName);

            Assert.IsTrue(exists);
        }
Пример #3
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);
            }
        }
        public void Creates_table_with_string_id()
        {
            // The Instrument test object has an int field named simply Id. Without any
            // Attribute decoration, this should result in a table with a serial int PK.

            // NOTE: Gotta go look to see if the field is a serial in or not...
            //var db = new CommandRunner("chinook");
            var  InstrumentStore = new SqliteDocumentStore <InstrumentDocuments>(_db);
            bool exists          = _db.TableExists(InstrumentStore.TableName);

            Assert.IsTrue(exists);
        }
        public void Creates_table_with_int_id()
        {
            // The Widget test object has an int field named Identifier. This will not be matched
            // without an attribute decoration, and horrible plague and pesilence will result. Also,
            // the attribute IsAuto property is set to false, so the field will NOT be a serial key.

            _db.TryDropTable("widgetdocuments");
            var  widgetstore = new SqliteDocumentStore <WidgetDocuments>(_db);
            bool exists      = _db.TableExists(widgetstore.TableName);

            Assert.IsTrue(exists);
        }
Пример #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);
        }
Пример #7
0
        public void Creates_table_with_serial_id()
        {
            // The Company test object has an int field named simply "Id". Without any
            // Attribute decoration, this should result in a table with a serial int PK.

            // NOTE: Gotta go look to see if the field is a serial in or not...
            //var db = new CommandRunner("chinook");

            _db.TryDropTable("companydocuments");
            var  companyStore = new SqliteDocumentStore <CompanyDocuments>(_db);
            bool exists       = _db.TableExists(companyStore.TableName);

            Assert.IsTrue(exists);
        }
Пример #8
0
 public void Table_Created_Created_for_SQLite_Store_With_Biggylist()
 {
     Assert.True(_db.TableExists("Property"));
 }
 public void Table_Created_Created_for_Sqlite_Store_With_Biggylist()
 {
     Assert.True(_db.TableExists("propertydocuments"));
 }