PostgreSqlMigrationSqlGenerator icon indicating copy to clipboard operation
PostgreSqlMigrationSqlGenerator copied to clipboard

Error on moving Table to different schema !?

Open borisdj opened this issue 11 years ago • 2 comments

Table by default will be put into 'dbo' schema. If I want to specify another schema I can do it like this: -------------------------------------------------------------- [Table("Movie", Schema = "cinema")] -------------------------------------------------------------- and it works fine.

But once I make table, and then I want to change it's schema it does not works. It successfully makes migration script: -------------------------------------------------------------- MoveTable(name: "dbo.Movie", newSchema: "cinema"); --------------------------------------------------------------

but on executing it gives error:

-------------------------------------------------------------- Npgsql.NpgsqlException: syntax error at or near "TRANSFER" Severity: ERROR Code: 42601 at Npgsql.NpgsqlState.<ProcessBackendResponses_Ver_3>d__a.MoveNext() at Npgsql.ForwardsOnlyDataReader.GetNextResponseObject() at Npgsql.ForwardsOnlyDataReader.GetNextRowDescription() at Npgsql.ForwardsOnlyDataReader.NextResult() at Npgsql.ForwardsOnlyDataReader..ctor(IEnumerable`1 dataEnumeration, CommandBehavior behavior, NpgsqlCommand command, NotificationThreadBlock threadBlock, Boolean synchOnReadError) at Npgsql.NpgsqlCommand.GetReader(CommandBehavior cb) at Npgsql.NpgsqlCommand.ExecuteNonQuery() at System.Data.Entity.Migrations.DbMigrator.ExecuteSql(DbTransaction transaction, MigrationStatement migrationStatement) --------------------------------------------------------------

borisdj avatar Apr 23 '13 14:04 borisdj

In this moment it doesn't support the MoveTable.

darionato avatar Apr 23 '13 15:04 darionato

Ok, at the moment I am doing it alternative way, drop and create new. If you add support for it in the future, send me info, thanks.

borisdj avatar Apr 23 '13 16:04 borisdj