I was faced with the project of migrating an mssql database to postgres (why? mainly because of licensing fees as we are about to go live with the solution – without any revenues any time soon 🙂 )
This is more a #notetoself if im faced with this again rather than any kind of guideline attempt – please feel free to contact me for details if I can in any way help – I would be happy to share my experience with this.
So, I thought I would document a checklist for those that might stumble across this post while preparing the same action. I was an absolute beginner with postgres when starting this process so some of the comments might feel a bit “verbal”.
The porting took me about 16 hours for a database with around 100 tables, 50 procedures, 50 functions. My process is not applicable for all as I moved the data between the database using json as staging storage for all data – creating a simple import mechanism in c# thought EF6.
Postgres only handles lowercase objects (schemas, table names, columns, procedure names, … ) without quotes. Prepare to rename everything! … unless you want to add a million double quotes to your database procedures and views.
Get ready with your favorite text editor with a lot of search-replace regexp.
When putting together dynamic queries and using the pipe || to concatenate strings (instead of + in mssql) make sure you declare empty strings as empty quotes – as when a null is “and-ed” with a string the result is null. I sent quite a few nulls to the execute statement when I was expecting the dynamic string to be full of meaning.
Had some problems with the EF6 – working with 2 tables in the UserManagement schema – created an automatic association table in the dbo schema. Look no further than here for an explanation and solution
#notetoself … Once again, scratching my head for way to long about something that turns out to have a simple workaround #devlife
On one of my (new) blazor pages (/Bookings/TeeTimes), onclick event was not firing. Didn’t matter what kind of flavour of onclick declaration I used, the event was not getting fired.
Until of course I noticed that this page was producing a lot of blazor loading errors:
Turns out I was running the project (as usual) from command line (dotnet) and had a shortcut in my browser to go directly to this page. Seems like that sets the “document root” to “Bookings” and from that it tries to find the blazor files.
Starting from the root page and navigating to the Bookings/TeeTimes page solved the problem, with the permanent fix being adding this within the head element of the layout
Við erum live c.a. þriðja hvern þriðjudag (þri-þri – auðvelt að muna) en hina 1-2 þriðjudagana á milli munum við hita upp með einhverju skemmtilegu myndskeiði sem leiðir okkur að efnisatriði næsta fundar. Sjáumst “live” eftir 2 vikur.
EF6 Core – reconfiguring navigation properties, the runtime was complaining about a column GolferId being missing (invalid database column).
Took me a minute to figure out and remember the default foreign key dependency naming convention in EF. Sometimes these frameworks are a bit too intelligent for my taste.
Turns out the EF was guessing that if I have a navigation property to a related entity called “User” – the framework will automatically use an object property field called “UserId” … easily solved with the ForeignKey tag 🙂