Пример #1
0
        public string Migrate_02_03_AlterTable_DropColumn(IDatabaseContext db)
        {
            var table = Helper.AlterTable("Table3")
                        .DeleteColumn("Date")
                        .DeleteColumn("Timestamp");

            db.AlterTable(table);
            table = Helper.AlterTable("Table1")
                    .DeleteColumn("Muciacia");
            db.AlterTable(table);
            return("203 - Alter table drop column");
        }
Пример #2
0
        public string Migrate_02_01_AlterTable_AddColumn(IDatabaseContext db)
        {
            var table = Helper.AlterTable("Table1")
                        .AddColumn("Muciacia", DbType.Byte, true)
                        .AddColumn("Senior", DbType.Boolean, false);

            db.AlterTable(table);

            table = Helper.AlterTable("Table1")
                    .AddAutoIncrementColumn("Id1", DbType.Int64);
            db.AlterTable(table);

            return("201 - Alter table add column");
        }
Пример #3
0
        public string Migrate_02_04_AlterTable_Combined(IDatabaseContext db)
        {
            var table = Helper.AlterTable("Table3")
                        .AddColumn("Date", DbType.Date, true)
                        .AddColumn("Razvan", DbType.Double, false)
                        .DeleteColumn("Id");

            db.AlterTable(table);

            table = Helper.AlterTable("Table1")
                    .DeleteColumn("Senior")
                    .AddColumn("Bunica", DbType.Decimal, false)
                    .AddColumn("Ion", DbType.StringFixedLength, 10, false)
                    .AlterColumn("Name", DbType.String, 500, true);


            db.AlterTable(table);
            return("203 - Alter table combined");
        }
Пример #4
0
        public string Migrate_4(IDatabaseContext db)
        {
            var table = Helper.AlterTable("Lucian")
                        .AddColumn("Razvan1", DbType.String, 23, true)
                        .AddColumn("Ok", DbType.Int64, false)
                        .DeleteColumn("Razvan");

            db.AlterTable(table);
            return("added razvan column");
        }
Пример #5
0
        public string Migrate_3(IDatabaseContext db)
        {
            var table = Helper.CreateTable("Lucian")
                        .AutoIncrementColumn("Id", DbType.Int64);

            db.CreateTable(table);

            var table1 = Helper.AlterTable("Lucian")
                         .AddColumn("Razvan", DbType.String, 423, true);

            db.AlterTable(table1);
            return("added razvan column");
        }