![]() So for me My last hurdle here is just to ensure that I can migrate my ids in my online database to string without damaging datas on the online platform. So it is easy to do a bulk insert without Since ids offline dont neccessary need to change with they get online. Cause for me when dealing with many tables I just feel it a lesser evil to deal with. Looking at the 2 evils, I decided to go with Bruce advice. So it made sense that I either ensure that relationships are properly maintained while adding data into the tables or I just change the IDs to GUID string. So I got to this point because when the online system gets the json object payload I try to save in bulk to all tables affected. I send a json payload that contains the bulk data that are not yet backed up on the cloud. I use a stored procedure to collectĪll my data in bulk. I also have a Background service that I have set a timer for that does the backup of data. ![]() I have created a button for administrators to synchronize data from offline app to online system. All tables that link to it are with empty data. So because some tables already link to that ID. ADD CONSTRAINT FOREIGN KEY () REFERENCES. ADD CONSTRAINT PRIMARY KEY ()ĪLTER TABLE. WHERE parent_object_id = object_id(N'dbo.Size')ĪND col_name(parent_object_id, parent_column_id) = 'SizeID' ĪLTER TABLE. WHERE parent_object_id = object_id(N'dbo.Categorizecustomer')ĪND col_name(parent_object_id, parent_column_id) = 'CategorizecustomerID' ĮXECUTE('ALTER TABLE. IF object_id(N'.', N'F') IS NOT NULLĪLTER TABLE. So the I would paste the sql script code that I generated. I would paste an example of my code first table. The reason is that the primary key that am trying to remove the auto increment form is related to some other tables. 'PK_dbo.Categorizecustomer' is not a constraint.Ĭould not drop constraint. So I have used the data Annotation that tells EFCore Code first Approach to ensure primary keys don't have an auto increment.īut unfortunately when I run the migration sql script generated I get the errors which are similar to what I would paste below. Sqlite AutoIncrement bug when more than one primary key Issue 15497 dotnet/efcore GitHub. So that I can drop data in the table in bulk. I am trying to set the primary of the online database tables to No Autoincrement. ![]() Because I have to back up data from Local database to online database. This simply means I have to similar database with similar schemas. So I have a requirement that ensures that data in my local database is backed up online.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |