Error in CodeFirst Seed with migrations : Modifying a column with the 'Identity' pattern is not supported. Column: 'CreatedAt'. Table: 'CodeFirstDatabaseSchema.Category'.

Hi,
I have activated migrations on my Azure Mobile Services project. I filled the new seed function Inside the Configuration.cs class of the migrations. If the tables are empty, the seed function is going without any problems. When my AddorUpdate tries to update
the first object I get the error in the inner exception : "Modifying a column with the 'Identity' pattern is not supported. Column: 'CreatedAt'. Table: 'CodeFirstDatabaseSchema.Category'."
Part of my code is as follows:
context.categories.AddOrUpdate(
new Category { Id="1", Code="GEN", Text="General"},
new Category { Id="2", Code="POL", Text="Politics"},
new Category { Id="3", Code="FAS", Text="Fashion"},
new Category { Id="4", Code="PEO", Text="People"},
new Category { Id="5", Code="TEC", Text="Technology"},
new Category { Id="6", Code="SPO", Text="Sport"},
new Category { Id="7", Code="LIV", Text="Living"}
Any help is welcomed. Thanks.
Faical SAID Highwave Creations

This occurred to me because I changed my POCO models to inherit from EntityData after I had already created my database without the extra Azure Mobile Service properties (UpdatedAt, CreatedAt, Deleted). The only way I fixed it was to drop the database and
start over with my classes inheriting from EntityData from the beginning. If you can't do that then I would create a new table with EntityData models and see how that database is created and manually update your tables to match those. Here's an image of one
of my tables from the management console on Azure. You can see that CreatedAt is an index.

Similar Messages

  • How to fix "Modifying a column with the 'Identity' pattern is not supported"

    When doing Code First Migrations my mobile service always errors in the seed method with: 'Modifying a column with the 'Identity' pattern is not supported. Column: 'CreatedAt'. Table: 'CodeFirstDatabaseSchema.Methodology' for the CreatedAt column. All my
    models inherit from EntityData. 
    // Sample model
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using Microsoft.WindowsAzure.Mobile.Service;
    namespace sbp_ctService.Models
    public class Methodology : EntityData
    public Methodology()
    this.Scenarioes = new List<Scenario>();
    public string Id { get; set; }
    [Required]
    [StringLength(50)]
    public string EntryMethod { get; set; }
    [Required]
    [StringLength(50)]
    public string TestDirection { get; set; }
    [Required]
    [StringLength(50)]
    public string PassCriteria { get; set; }
    [Required]
    [StringLength(50)]
    public string Dependency { get; set; }
    public bool ExtraInfo { get; set; }
    public virtual ICollection<Scenario> Scenarioes { get; set; }
    And in my Configuration.cs file during an update here's my seed method:
    protected override void Seed(sbp_ctService.Models.sbp_ctContext context)
    // This method will be called after migrating to the latest version.
    context.Methodologies.AddOrUpdate(
    m => m.Id,
    new Methodology { Id = "Methodology1", EntryMethod = "P/F", PassCriteria = "P/F", Dependency = "None", ExtraInfo = false, TestDirection = "Round" },
    new Methodology { Id = "Methodology2", EntryMethod = "P/F", PassCriteria = "Best", Dependency = "None", ExtraInfo = false, TestDirection = "Round" },
    new Methodology { Id = "Methodology3", EntryMethod = "P/F", PassCriteria = "Best", Dependency = "None", ExtraInfo = false, TestDirection = "In/Out" },
    new Methodology { Id = "Methodology4", EntryMethod = "P/F", PassCriteria = "Best", Dependency = "None", ExtraInfo = false, TestDirection = "Out" }
    For some reason on an update the CreatedAt field is created and given a value of null. So of course on an insert/update it will error because CreatedAt is an Identity field.
    I've tried to configure the modelBuilder in my context to tell it that CreatedAt is an identity field, but that still doesn't work.
    modelBuilder.Entity<Methodology>()
    .Property(m => m.CreatedAt)
    .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
    So far the only way to fix this is by commenting out my Seed data, but it's not a fix. I've seen other solutions where you can force it to not serialize certain fields, but I don't know if those solutions apply.

    So I think this occurs because you might have created the database (Code-first) with POCOs that didn't have the CreatedAt field in them. I think that's what I did and the easiest way to fix it for me was to delete my database and re-create it with my POCOs
    inheriting from Entity Data from the very beginning. We were still in development so it worked out for us but I know some people might not be able to do that. Here's what my table looks like after it was created correctly:
    USE [database_name]
    GO
    /****** Object: Table [sbp_ct].[Methodologies] Script Date: 2/24/2015 9:48:45 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [schema_name].[Methodologies] (
    [Id] NVARCHAR (128) NOT NULL,
    [EntryMethod] NVARCHAR (50) NOT NULL,
    [TestDirection] NVARCHAR (50) NOT NULL,
    [PassCriteria] NVARCHAR (50) NOT NULL,
    [Dependency] NVARCHAR (50) NOT NULL,
    [ExtraInfo] BIT NOT NULL,
    [Version] ROWVERSION NOT NULL,
    [CreatedAt] DATETIMEOFFSET (7) NULL,
    [UpdatedAt] DATETIMEOFFSET (7) NULL,
    [Deleted] BIT NOT NULL,
    [Name] NVARCHAR (MAX) NULL
    GO
    CREATE CLUSTERED INDEX [IX_CreatedAt]
    ON [schema_name].[Methodologies]([CreatedAt] ASC);
    GO
    ALTER TABLE [schema_name].[Methodologies]
    ADD CONSTRAINT [PK_schema_name.Methodologies] PRIMARY KEY NONCLUSTERED ([Id] ASC);
    Does yours look something like that?

  • "Modifying a column with the 'Identity' pattern is not supported. Column: 'CreatedAt'.

    I am using code fist migration and second time I run the service, I got this error.
     "Modifying
    a column with the 'Identity'pattern
    is not supported. Column:
    'CreatedAt'. 
    context.Cars.AddOrUpdate(c => c.Id,
    new Car { Id = "60B0891B-C3CF-41A6-9BE0-BCCCE5949E6B", Image = "ic_highlander", Name = "Highlander", Description = "4 SEATER, FULL DAY (10 HRS), DOWNTOWN EXCLUDING INDUSTRIAL ZONE, WITH ENGLISH SPEAKING DRIVER", SeatingCapacity = 4, Luggage = 2, Rates = 20000.00M, AirportCode = "YGN" },
    new Car { Id = "BAA205B5-C43F-490E-A83B-81F0EBDA2D97", Image = "ic_super_custom", Name = "Super Custom", Description = "4 SEATER, FULL DAY (10 HRS), DOWNTOWN EXCLUDING INDUSTRIAL ZONE, WITH ENGLISH SPEAKING DRIVER", SeatingCapacity = 4, Luggage = 2, Rates = 20000.00M, AirportCode = "YGN" },
    new Car { Id = "DD68E56D-3967-4D32-A959-BEFBCB70FC4B", Image = "ic_mark_ii_grande", Name = "MarkII GRANDE", Description = "4 SEATER, FULL DAY (10 HRS), DOWNTOWN EXCLUDING INDUSTRIAL ZONE, WITH ENGLISH SPEAKING DRIVER", SeatingCapacity = 4, Luggage = 2, Rates = 20000.00M, AirportCode = "YGN" },
    new Car { Id = "8EDDC308-FB63-469B-8A6A-B2360D61892D", Image = "ic_hiace_commuter_13", Name = "Hiace commuter", Description = "4 SEATER, FULL DAY (10 HRS), DOWNTOWN EXCLUDING INDUSTRIAL ZONE, WITH ENGLISH SPEAKING DRIVER", SeatingCapacity = 4, Luggage = 2, Rates = 20000.00M, AirportCode = "MDL" }

    Hi,
    Thanks for posting here.
    We are looking into this and will update you with solution. Stay tuned for details
    Girish Prajwl

  • Since installing Lion I keep getting the error message 'there was a problem connecting to the server. URLs with the type 'file:" are not supported"' How can I fix this?

    since installing Lion I keep getting the error message 'there was a problem connecting to the server. URLs with the type 'file:" are not supported"' How can I fix this?

    A Davey1 wrote:
    Not a nice answer!
    Posting "Check the 'More like this'" area and not simply providing the answer is a great way to make these groups worthless.
    You're ignoring context.  On the old Apple Discussion Groups I never posted replies like that, instead giving people relatively detailed answers.  The new Apple Support Communities made things worse by introducing certain inefficiencies.  Then came Lion.  The flood of messages that came with Lion required a painful choice for any of the people who had been helping here: (1) Give quality responses to a few questions and ignore the rest.  (2) When applicable, give a brief answer such as the one that you found objectionable.  (3) Give up all the other normal activities of life and spend full time trying to answer questions here.
    People who needed help with Lion problems seemed to have trouble discovering existing message threads that described how to solve their problems.  I never posted the suggestion of "Check the 'More like this' area" without verifying that the help that the poster needed could be found there.  Even doing that, what I posted saved me time that I could use to help someone else.
    The people helping here are all volunteers.  None of them is being paid for the time they spend here.  They all have a life outside of Apple Support Communities.  It's arrogant of you to demand that people helping here spend more time than they already do.

  • I'm being shown an error pop-up message periodically saying "There was a problem connecting to the server. URLs with the type 'file:' are not supported." I have a brand new MacBook Pro, and at no time am I actually having trouble connecting to the server.

    I'm being shown an error pop-up message periodically saying "There was a problem connecting to the server. URLs with the type 'file:' are not supported." I have a brand new MacBook Pro, and at no time am I actually having trouble connecting to the server, but this message continues to pop-up several times a day at random intervals. Is there something I'm doing wrong? Or is my computer just having a glitch? Other than that, and a mildly sticking caps lock button, it's working perfectly.
    Thank you!

    Alright it didn't solve it. Any other suggestions?
    I haven't suggested a solution yet. I want to know whether you still get the messages while Time Machine is disabled. Do you? If so, try any or all of the solutions proposed in this thread:
    There was a Problem connecting to the...: Apple Support Communities

  • I keep getting an error message saying "There was a problem connecting to the server.  URLs with the type "file:" are not supported."  Can someone help me get rid of it.

    I keep getting an error message saying "There was a problem connecting to the server.  URLs with the type "file:" are not supported"  Can someone help me locate and get rid of this error.

    Open the Time Machine pane in System Preferences. If it shows that Time Machine is ON, click the padlock icon in the lower left corner, if necessary, to unlock it. Scroll to the bottom of the list of backup drives and click Add or Remove Backup Disk. Remove all the disks, then add them back. Quit System Preferences. Test.

  • Since updating to mountain line, error message "There was a problem connecting to the server. URLs with the type "file:" are not supported" keeps popping up

    Since updating to Mountain Lion in the last week, an error message keeps popping up. The graphic is the button with 3 stick men holding hands and the message is "There was a problem connecting to the server. URLs with the type "file:" are not supported". Any solutions found?

    Open the Time Machine pane in System Preferences. If it shows that Time Machine is ON, click the padlock icon in the lower left corner, if necessary, to unlock it. Scroll to the bottom of the list of backup drives and click Add or Remove Backup Disk. Remove all the disks, then add them back. Quit System Preferences. Test.

  • After loading lion, I get an error message "There was a problem connecting with the server.  URL's with the type "file" are not supported."

    After loading Lion, I have been getting an error message "There was a problem connecting to the server.  URLs with the type "file:" are not supported."  There does not seem to be any actual problem with internet connectivity, but it is persistent and annoying.  Any idea of its cause and treatment?

    Take a look at this link, https://discussions.apple.com/message/16156214#16156214

  • Error message: URL's with the type "file:" are not supported.  I get this pop-up twice each time I enter Safari and Mail.

    Everytime I go into Mail and/or Safari, I receive a pop-up the states "There was a problem connecting to the server.  URL's with the type "File:" are not supported.  The pop-up comes up twice each time and I have to click "ok" to close them.  Only started after install of OS Lion 10.7.  Any one else have this and is there a solution.  It is just plain irrating that is does this each time I check my mail or go on the internet.  Thanks!

    That's interesting. I bet that helps other Safari users! 

  • Error Message: "The formula syntax is not supported by the report"

    We are using 'Development Environment: SAP Crystal Reports, version for Visual Studio 2010 u2013 Standard ' and using CrystalDecisions.CrystalReports.Engine and CrystalDecisions.ReportAppServer APIu2019s
    I am reading SQLExpressionFields from one source .rpt file & want to add it to another ReportDocument. While doing so, it gives an error " The formula syntax is not supported by the report"
    doc.ReportClientDocumentDataDefController.FormulaFieldController.Add(formualField); // formualField is SQLExpressionField from source ReportDocument
    But when I tried to Add FormulaField, it succeeds
    Please help me in knowing how to add SQlExpressionFields to ReportDocument.
    Regards,
    -atul

    Thanx Don & Ludek for the reply.
    CR provides support for addition/modification of SQLExpressions.
    CRAXDRT.Application application = new CRAXDRT.ApplicationClass();
    CRAXDRT.Report innerReport = application.OpenReport(path, CROpenReportMethod.crOpenReportByTempCopy);
    innerReport .SQLExpressionFields.Add(name, strSQLExpression)
    CRAXDRT.dll provides support for addition/modification of SQLExpression fields. But its not compatible with 64bit.
    Just curious to know, is there any future plan to provide support for add/modify SQLExpression fields?
    Thanx
    -atul
    Edited by: Atul Chivate on Aug 21, 2011 6:13 PM

  • "Cannot play video - The Connected display is not supported" error message using Netflix 5.0.2 on my iPad

    I'm running iOS 7.0.3 on my iPhone 4S and iPad (3rd gen) and have just upgraded to the current version of the Neflix app available in the Canadian App Store (5.0.2).
    Although all other apps I've tried (e.g. Podcast, VLC) are able to properly output video & audio directly to my TV using the HDMI adapter (i.e. NOT via an Apple TV), the Netflix app pops up the error message "Cannot play video - The connected display is not supported".  If I start a video and then plug the HDMI cable in, it will play for a few seconds and then halt with the same error message.
    Netflix & Apple were supposed to have been working together to fix the previous issue with this scenario which was causing audio to be output but no video.  The current Netflix app update was released yesterday and seems to have taken a step backward.
    When I contacted Netflix support, they indicated that they have done whatever can be done from their side and this is now Apple's issue.
    Any ideas?
    Thanks!
    Kiron

    Hello all,
    I have an iPad 2 16GB with iOS 7.0.3 and Netflix version 5.0.2. I cannot watch netflix on an External LCD monitor that I have through VGA out. I use bluetooth speakers, so the AirPlay is going to that for Audio. Before this update, this combo worked without an issue.
    So as of Friday Nov. 8/2013, I contacted Netflix support, and they said they fixed the problem on their end, and the fix is on the Apple side of things, and to contact Apple support.
    So, I contacted Apple support, and the first person I spoke to said I would have to agree to pay a $35 fee for 30 days of support to this problem since my unit is out of warranty. I said this isn't a hardware issue, it's a software issue, and I'm not willing to pay to fix a problem you created. So I got a Senior Level advisor on the line, and she was helpful, and she's looking into the issue for me and said she'll contact me sometime on Tuesday or Wednesday (Nov. 12 or 13) to let me know of the issue.
    Here's the thing: this is a combination of Netflix and iOS not working correctly with any of the Apple Authorized Dongles. This is truly a code error that some hot shot programmer had major oversight on, and their management didn't catch it either. There was no reason for Netflix to rush to get this Netflix update going until Apple sorted out the bugs in iOS 7.
    Anyway, if I hear anything from Donna (the advisor), I'll post it and let you guys know. In the mean time, good luck!

  • SQL SERVER - Error while executing SSIS package on specific environment : Connection manager - The specified module could not be found

    I have deployed my SSIS packages on SQL 2008 server.
    I have a .bat file which will invoke these packages and also the bat file is placed in the server where the SSIS packages are deployed.
    Scenario 1:
    I double clicked on the bat file to invoke the SSIS packages and ; this executed successfully
    Scenario 2:
    I have used the IBM Tivoli work scheduler(TWS)  to invoke the bat file which in tern will invoke the ssis packges; 
    but when i do this i am getting the below error
     Code: 0x8007007E
       Source: SSIS_Master_Event_Data_Transfer Connection manager "Config DB"
       Description: The specified module could not be found.
    Config BD is a connection manager which will get the connection string from the config file of the SSIS package.
    Please help me to resolve this issue.
    Regards,
    Prakash

    Check you TWS jobmanrc.cmd configuration file.   You may need to add a PATH environment variable in that file that includes your SQL Server file locations.   When TWS jobs are executed, they may not be executing with the same
    PATH variable as when you execute the SSIS outside of TWS.

  • How can I get my stereo to play music videos from my Ipod Nano?  It comes up with the message "This device not supported".  Strangely my Iphone IS recognised.  The stereo, Ipod, and Iphone are less than 4 months old. Any suggestions welcome!

    How do I get my Ipod to play music videos through my theatre system?  I keep getting the message "This device not supported".  My theatre system WILL recognise my Iphone however.  The theatre system, Ipod, and Iphone are all less than 4 months old.  Any suggestions welcome!

    Check with the theater system vendor and see if their system is compatible with the Nano. The resolution on the Nano may be too low for the system.

  • I have a 27" desktop mac running with OSX 10.6.8.  The bluetooth keyboard started not typing when some of the keys are pressed. Plugged in a wired keyboard, started doing the same thing.  Now the cursor moves but cannot select anything.  Suggestions?

    I have a 27" desktop mac running with OSX 10.6.8.  The bluetooth keyboard started not typing when some of the keys are pressed. Plugged in a wired keyboard, started doing the same thing.  When opening up a browser or application, the cursor moves but cannot select anything.  Suggestions?

    Maybe something in these Apple support articles will help.
    Keyboard Doesn’t Work
    Keyboard Keys Do Not Respond
    Keyboard/Mouse – Troubleshooting Wireless

  • I am trying to download a free trial of photoshop for my macbook pro and it says there is an error and that the requirements for the new version is not supported for the mac I have. I have looked at the list of requirements but have no idea how to tell wh

    I am trying to download a free trial of photoshop for my macbook pro and it says there is an error and that the requirements for the new version is not supported for the mac I have. I have looked at the list of requirements but have no idea how to tell what I do and do not have?

    Apple Menu --> About this Mac.
    Mylenium

Maybe you are looking for

  • My iPod 4th gen isn't showing up in iTunes after I tried restoring it?

    My iPod's been having some problems so I decided to restore it and start afresh. I plugged it into my laptop, restored via iTunes (as I have done so a few times before successfully), and it seemed to be going good. But then a message popped up saying

  • Lost my library while switching over to an external hard drive but...

    I was able to restore all my purchased items when I hook my I-pod up to the PC. I have not resynced my I-pod since so all my music and playlists are still intact on the I-Pod. Is there a way to tranport all that back into my very empty library? I cop

  • SC not being converted to PO

    Hi Gurus, Right now, we're having some troubles with a Shopping Cart that got stuck on Approved status and doesn't appear in the Carry Out Sourcing. Per what I see in BBP_PD: HEADER     I1009          Held                           X HEADER     I1015

  • Making a referenced field a range?

    Hi there I'm currently doing a dialog programming lets say I have a custom table Z_ABC with MATNR field. When i get this field from dictionary at layout, it shows as a normal single input field. Can I make this field a range?

  • Parent class and Casting

    Hi all, I need to store different classes in a Vector. The classes have in common that they are all different views (MVC!). If I make a common parent, can I cast to that parent without problems? Background: I'm programming on a mobile, which uses dif