Пример #1
0
 void Create(DataStoreContext store)
 {
     store.CreateDatabase();
     var schemaUpdater = store.CreateDatabaseSchemaUpdater();
     schemaUpdater.DatabaseSchemaVersion = CURRENT_VERSION;
     schemaUpdater.Execute();
 }
Пример #2
0
        void Create(DataStoreContext store)
        {
            store.CreateDatabase();
            var schemaUpdater = store.CreateDatabaseSchemaUpdater();

            schemaUpdater.DatabaseSchemaVersion = CURRENT_VERSION;
            schemaUpdater.Execute();
        }
Пример #3
0
        public void Upgrade(DataStoreContext store)
        {
            if (!store.DatabaseExists())
            {
                Create(store);
                return;
            }

            var schema  = store.CreateDatabaseSchemaUpdater();
            int version = schema.DatabaseSchemaVersion;

            switch (version)
            {
                case 0 : store.DeleteDatabase(); Create(store); break;

                default : return;
            }

            schema.DatabaseSchemaVersion = CURRENT_VERSION;
            schema.Execute();
        }
Пример #4
0
        public void Upgrade(DataStoreContext store)
        {
            if (!store.DatabaseExists())
            {
                Create(store);
                return;
            }

            var schema  = store.CreateDatabaseSchemaUpdater();
            int version = schema.DatabaseSchemaVersion;

            switch (version)
            {
            case 0: store.DeleteDatabase(); Create(store); break;

            default: return;
            }

            schema.DatabaseSchemaVersion = CURRENT_VERSION;
            schema.Execute();
        }