Пример #1
0
 static void EnsureTableExists(UmbracoDatabase database)
 {
     if (!database.TableExist(Visitor.TableName))
     {
         database.CreateTable <Visitor>();
     }
 }
Пример #2
0
 static void EnsureTableExists(UmbracoDatabase database)
 {
     if (!database.TableExist(VisitorMongoMapping.DatabaseName))
     {
         database.CreateTable <VisitorMongoMapping>();
     }
 }
Пример #3
0
 public override void Up()
 {
     if (!_db.TableExist("PublishQueue"))
     {
         _db.CreateTable <QueuedItem>(false);
     }
 }
Пример #4
0
 public ContactForm()
 {
     _database = ApplicationContext.Current.DatabaseContext.Database;
     if (!_database.TableExist("ContactForm"))
     {
         _database.CreateTable <ContactFormPoco>();
     }
 }
Пример #5
0
 public static void CreateLegacyTable()
 {
     // Check if the DB table does NOT exist
     if (!_db.TableExist(_dbName))
     {
         //Create DB table - and set overwrite to false
         _db.CreateTable <AcProductDto>(false);
     }
 }
Пример #6
0
        private void EnsureTable()
        {
            if (_database.TableExist(MigrationRecord.DefaultTableName))
            {
                return;
            }

            _database.CreateTable <MigrationRecord>();
        }
Пример #7
0
 public ExternalLoginStore()
 {
     if (!System.IO.File.Exists(IOHelper.MapPath("~/App_Data/UmbracoIdentity.sdf")))
     {
         using (var en = new SqlCeEngine(ConnString))
         {
             en.CreateDatabase();
         }
     }
     _db = new UmbracoDatabase(ConnString, "System.Data.SqlServerCe.4.0");
     if (!_db.TableExist("ExternalLogins"))
     {
         _db.CreateTable <ExternalLoginDto>();
     }
 }
Пример #8
0
        public ExternalLoginStore()
        {
            if (identityStoreConnection == null)
            {
                throw new ConfigurationException("UmbracoIdentityStore is not set in the configuration");
            }

            _db = new UmbracoDatabase(identityStoreConnection.ConnectionString, "System.Data.SqlClient");
            if (!_db.TableExist("ExternalLogins"))
            {
                //unfortunately we'll get issues if we just try this because of differing sql syntax providers. In newer
                // umbraco versions we'd just use the DatabaseSchemaHelper. So in the meantime we have to just
                // do this manually and use reflection :(;
                _db.CreateTable <ExternalLoginDto>();
            }
        }
Пример #9
0
        private async Task <bool> SetupDatabase()
        {
            await Out.WriteLineAsync("Chauffeur Delivery does not have its database setup. Setting up now.");

            try
            {
                database.CreateTable <ChauffeurDeliveryTable>(true);
            }
            catch (Exception ex)
            {
                Out.WriteLine("Error creating the Chauffeur Delivery tracking table.");
                Out.WriteLine(ex.ToString());
                return(false);
            }

            await Out.WriteLineAsync("Successfully created database table.");

            return(true);
        }
Пример #10
0
        private static void CreateDataBase(UmbracoDatabase db)
        {
            if (!db.TableExist("ContactMessage"))
            {
                db.CreateTable <ContactPoco>(false);
            }

            if (!db.TableExist("ContactSettings"))
            {
                db.CreateTable <ContactSettings>(false);
                var settingsTwo = new List <ContactSettings>()
                {
                    new ContactSettings()
                    {
                        ConfigName   = "PageSize",
                        ConfigValue  = "10",
                        ConfigText   = "Page Size",
                        ConfigHelper = "",
                        ConfigSort   = 9
                    },
                    new ContactSettings()
                    {
                        ConfigName   = "AutoReplyMessage",
                        ConfigValue  = "Thanks for contacting us",
                        ConfigText   = "Auto Reply Message",
                        ConfigHelper = "",
                        ConfigSort   = 3
                    },
                    new ContactSettings()
                    {
                        ConfigName   = "TemplateNode",
                        ConfigValue  = "",
                        ConfigText   = "Auto Reply Template",
                        ConfigHelper = "",
                        ConfigSort   = 4
                    },
                    new ContactSettings()
                    {
                        ConfigName   = "SendNotificationTo",
                        ConfigValue  = "",
                        ConfigText   = "Send Notification To",
                        ConfigHelper = "*Use commas to include multiple email",
                        ConfigSort   = 7
                    },
                    new ContactSettings()
                    {
                        ConfigName   = "NotificationMessage",
                        ConfigValue  = "You have new message from %name%",
                        ConfigText   = "Notification Message",
                        ConfigHelper = "",
                        ConfigSort   = 6
                    },
                    new ContactSettings()
                    {
                        ConfigName   = "AutoReplySubject",
                        ConfigValue  = "Thanks for contacting us %name%",
                        ConfigText   = "Auto Reply Subject",
                        ConfigHelper = "",
                        ConfigSort   = 2
                    },
                    new ContactSettings()
                    {
                        ConfigName   = "NotificationSubject",
                        ConfigValue  = "New message from %name%",
                        ConfigText   = "Notification Subject",
                        ConfigHelper = "",
                        ConfigSort   = 5
                    },
                    new ContactSettings()
                    {
                        ConfigName   = "NotificationTemplateNode",
                        ConfigValue  = "",
                        ConfigText   = "Notification Template",
                        ConfigHelper = "",
                        ConfigSort   = 8
                    },
                    new ContactSettings()
                    {
                        ConfigName   = "SenderEmail",
                        ConfigValue  = "*****@*****.**",
                        ConfigText   = "Sender Email",
                        ConfigHelper = "",
                        ConfigSort   = 0
                    },
                    new ContactSettings()
                    {
                        ConfigName   = "DisplayNameSender",
                        ConfigValue  = "Noreply You Website",
                        ConfigText   = "Display Name Sender",
                        ConfigHelper = "",
                        ConfigSort   = 1
                    }
                };

                db.BulkInsertRecords(settingsTwo);

                db.Execute(
                    "CREATE TABLE uContactorVersion (DbVersion INT)");

                db.Execute(
                    "INSERT INTO uContactorVersion values(1)");
            }
        }