aspnet / MusicStore

[Archived] MusicStore test application that uses ASP.NET/EF Core. Project moved to https://github.com/aspnet/AspNetCore
1.3k stars 878 forks source link

Cannot publish to azure. Sql Error. #496

Closed punkouter2021 closed 8 years ago

punkouter2021 commented 9 years ago

Anyone else get this ? Is there a workaround ?

System.Data.SqlClient.SqlException
Keyword or statement option 'sequence' is not supported in this version of SQL Server.

D:\home\site\approot\src\MusicStore\Models\SampleData.cs
Line 25:                  if (sqlServerDatabase != null)
Line 26:                  {
Line 27:                      if (await sqlServerDatabase.EnsureCreatedAsync())
Line 28:                      {
Line 29:                          await InsertTestData(serviceProvider);
Eilon commented 8 years ago

@divega this issue is a bit old, but does it look familiar to you? The current code is a tiny bit different: https://github.com/aspnet/MusicStore/blob/dev/src/MusicStore/Models/SampleData.cs#L26

Was there any known issue on SQL Azure with certain EF operations? (E.g. Database.EnsureCreatedAsync().)

divega commented 8 years ago

Yes, it looks familiar. This exception came up a long time ago when we were using sequences by default for auto-increment columns in SQL Server which is a feature that at least at that time wasn't supported in Azure SQL Database. We have swapped to use IDENTITY since then so it shouldn't be an issue anymore.

divega commented 8 years ago

Closing as per the comment above the default behavior in EF should now work with Azure SQL DB but feel free to reopen or create a new issue if you hit the issue again.