示例#1
0
        public void GenerateCreateTable(ITableStructure ts, ISqlDumper dmp)
        {
            var tbl = new TableStructure(ts);

            RemoveUnwantedTableFeature(tbl);
            dmp.CreateTable(tbl);
        }
示例#2
0
 private void CreateTables()
 {
     LogMessage("Generating create tables");
     if (_options.TableOptions.CreateTables)
     {
         _tables.ForEach(x => _dmp.CreateTable(x.WithoutIndexes().WithoutReferences()));
     }
     LogMessage("Generating create indexes");
     if (_options.TableOptions.CreateIndexes)
     {
         _tables.SelectMany(x => x.Indexes).ToList().ForEach(x => _dmp.CreateIndex(x));
     }
 }
示例#3
0
        public override void GenerateSql(IDatabaseSource db, FullDatabaseRelatedName objname, ISqlDumper dmp, ISqlDialect dialect)
        {
            var ts  = db.InvokeLoadViewStructure(objname.ObjectName);
            var tbl = new TableStructure(ts);

            tbl.FullName = objname.ObjectName;
            if (Prefix != null)
            {
                tbl.FullName = new NameWithSchema(tbl.FullName.Schema, Prefix + tbl.FullName.Name);
            }
            if (Postfix != null)
            {
                tbl.FullName = new NameWithSchema(tbl.FullName.Schema, tbl.FullName.Name + Postfix);
            }
            dmp.CreateTable(tbl);
        }