public DatabaseCurrentVersionProvider(Database Database) { this.Database = Database; var migrator = new Migrator(Database); if (!migrator.TableExists<CurrentVersionEntry>()) { migrator.CreateTable<CurrentVersionEntry>(false) .AddColumn("MigrationName", typeof(string), 200) .AddColumn("Version", typeof(string), 100) .Execute(); } }
protected override void execute() { if (!Migrator.TableExists <SystemInfo>()) { Migrator.CreateTable <SystemInfo>(true).Execute(); Migrator.Database.Insert(new SystemInfo() { key = "administrators", Value = "admin" }); Migrator.Database.Insert(new SystemInfo() { key = "barkKeyId", Value = "TEg0VDlWNVU0Ug==".Base64Decode(), }); Migrator.Database.Insert(new SystemInfo() { key = "barkTeamId", Value = "NVU4TEJSWEczQQ==".Base64Decode(), }); Migrator.Database.Insert(new SystemInfo() { key = "barkPrivateKey", Value = "LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JR1RBZ0VBTUJNR0J5cUdTTTQ5QWdFR0NDcUdTTTQ5QXdFSEJIa3dkd0lCQVFRZzR2dEMzZzVMNUhnS0dKMitUMWVBMHRPaXZSRXZFQVkyZytqdVJYSmtZTDJnQ2dZSUtvWkl6ajBEQVFlaFJBTkNBQVNtT3MzSmtTeW9HRVdac1VHeEZzLzRwdzFySWxTVjJJQzE5TTh1M0c1a3EzNnVwT3d5RldqOUdpM0VqYzlkM3NDNytTSFJxWHJFQUpvdzgvN3RScFYrCi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0=".Base64Decode() }); } if (!Migrator.TableExists <SendInfo>()) { Migrator.CreateTable <SendInfo>(true).Execute(); } if (!Migrator.TableExists <SendUserInfo>()) { Migrator.CreateTable <SendUserInfo>(true).Execute(); SendUserInfo userInfo = new SendUserInfo() { Token = Guid.NewGuid().ToString("N").ToUpper(), UserName = "******", Email = "*****@*****.**", CreateTime = DateTime.Now, Active = true, Password = "******".ToMd5() }; Migrator.Database.Insert(userInfo); } if (!Migrator.TableExists <SendAuthInfo>()) { Migrator.CreateTable <SendAuthInfo>(true).Execute(); } }
public void Run() { if (!m_migrator.TableExists <SendInfo>()) { m_migrator.CreateTable <SendInfo>(true).Execute(); } if (!m_migrator.TableExists <SystemInfo>()) { m_migrator.CreateTable <SystemInfo>(true).Execute(); DBase.Insert(new SystemInfo() { key = "administrators", Value = "admin" }); } if (!m_migrator.TableExists <SendUserInfo>()) { m_migrator.CreateTable <SendUserInfo>(true).Execute(); SendUserInfo userInfo = new SendUserInfo() { Token = "112D77BAD9704FFEAECD716B5678DFBE".ToUpper(), UserName = "******", Email = "*****@*****.**", CreateTime = DateTime.Now, Active = true, Password = "******".ToMd5() }; DBase.Insert(userInfo); } if (!m_migrator.TableExists <SendAuthInfo>()) { m_migrator.CreateTable <SendAuthInfo>(true).Execute(); } }
protected override void execute() { if (!Migrator.TableExists <SystemInfo>()) { Migrator.CreateTable <SystemInfo>(true).Execute(); Migrator.Database.Insert(new SystemInfo() { key = "administrators", Value = "admin" }); } if (!Migrator.TableExists <SendInfo>()) { Migrator.CreateTable <SendInfo>(true).Execute(); } if (!Migrator.TableExists <SendUserInfo>()) { Migrator.CreateTable <SendUserInfo>(true).Execute(); SendUserInfo userInfo = new SendUserInfo() { Token = Guid.NewGuid().ToString("N").ToUpper(), UserName = "******", Email = "*****@*****.**", CreateTime = DateTime.Now, Active = true, Password = "******".ToMd5() }; Migrator.Database.Insert(userInfo); } if (!Migrator.TableExists <SendAuthInfo>()) { Migrator.CreateTable <SendAuthInfo>(true).Execute(); } }