public static void CreateIndex(this Rock.Plugin.Migration migration, string table, string[] columns, bool unique = false, string name = null, bool clustered = false, object anonymousArguments = null)
        {
            var mini = new MiniMigration();

            mini.CreateIndex(table, columns, unique, name, clustered, anonymousArguments);
            migration.Sql(mini.GetMigrationSql(migration.SqlConnection));
        }
        public static void AddPrimaryKey(this Rock.Plugin.Migration migration, string table, string column, string name = null, bool clustered = true, object anonymousArguments = null)
        {
            var mini = new MiniMigration();

            mini.AddPrimaryKey(table, column, name, clustered, anonymousArguments);
            migration.Sql(mini.GetMigrationSql(migration.SqlConnection));
        }
        public static void AddForeignKey(this Rock.Plugin.Migration migration, string dependentTable, string[] dependentColumns, string principalTable, string[] principalColumns = null, bool cascadeDelete = false, string name = null, object anonymousArguments = null)
        {
            var mini = new MiniMigration();

            mini.AddForeignKey(dependentTable, dependentColumns, principalTable, principalColumns, cascadeDelete, name, anonymousArguments);
            migration.Sql(mini.GetMigrationSql(migration.SqlConnection));
        }
Ejemplo n.º 4
0
        public static void Run <TColumns>(this TableBuilder <TColumns> tableBuilder, Rock.Plugin.Migration migration)
        {
            FieldInfo   fiMigration = tableBuilder.GetType().GetField("_migration", BindingFlags.NonPublic | BindingFlags.Instance);
            DbMigration dbMigration = fiMigration.GetValue(tableBuilder) as DbMigration;

            migration.Sql(GetMigrationSql(dbMigration, migration.SqlConnection));
        }