This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Is it possible to customize the precision and scale when mapping decimal data types and migrations. I have a monetary amount that is mapping to decimal(24,18) in SQL server when I run the migration. According to Microsoft: decimal [ (p[ ,s] )] and numeric[ (p[ ,s] )] Fixed precision and scale numbers. When maximum precision is used, valid values are from - 10^38 +1 through 10^38 - 1. The ISO synonyms for decimal are dec and dec(p, s). numeric is functionally equivalent to decimal. p (precision) The maximum total number of decimal digits that will be stored, both to the left and to the right of the decimal point. The precision must be a value from 1 through the maximum precision of 38. The default precision is 18. s (scale) The number of decimal digits that will be stored to the right of the decimal point. This number is subtracted from p to determine the maximum number of digits to the left of the decimal point. (see https://msdn.microsoft.com/en-us/library/ms187746.aspx) This means that the largest number I can store is 999999.999999999999999999 which is less than one million and simply not big enough. I want to tell the migrations engine to create the SQL column with more digits to the left of the decimal. but I do not see a property in the designer to do this. |
|
|
No we don't have any controls available for customising this so you will need to use a manual migration to add the column via ExecuteNativeCommand to specify a custom scale/precision.
|
|
|
So, does this mean that if I want to remain database independent (so that my customer can choose the database provider) then I may need to code that execute native command for each provider type? I'd prefer to let Lightspeed handle all of the interaction with the database rather that coding specific commands. Are you willing to add this to your backlog so that in the future it can be done with the designer? |
|
|
Yes thats correct, you would need to execute a provider specific custom migration in each case. Ill add this to our backlog but Id suggest you also create a feature request for this as we are only likely to look at this if we have enough interest.
|
|
|
Done. Thanks! |
|