Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up FormatSystemMethods quoter #1156

Closed
jzabroski opened this issue Jan 21, 2020 · 1 comment
Closed

Clean up FormatSystemMethods quoter #1156

jzabroski opened this issue Jan 21, 2020 · 1 comment
Assignees
Milestone

Comments

@jzabroski
Copy link
Collaborator

@jzabroski jzabroski self-assigned this Feb 17, 2020
@jzabroski
Copy link
Collaborator Author

jzabroski commented Feb 17, 2020

Something like this:

src\FluentMigrator.Runner.Db2\Generators\Db2\Db2Quoter.cs

        {
            switch (value)
            {
                case SystemMethods.NewSequentialId:
                case SystemMethods.NewGuid:
                    return base.FormatSystemMethods(value);
                case SystemMethods.CurrentUTCDateTime:
                    /*
                     * (The CURRENT TIMEZONE value is determined from C runtime functions.)
                     * Source: https://www.ibm.com/support/knowledgecenter/en/SSEPGG_9.7.0/com.ibm.db2.luw.sql.ref.doc/doc/r0005887.html
                     */
                    return "(CURRENT_TIMESTAMP - CURRENT_TIMEZONE)";
                case SystemMethods.CurrentDateTime:
                    return "CURRENT_TIMESTAMP";

src\FluentMigrator.Runner.Firebird\Generators\Firebird\FirebirdQuoter.cs

                case SystemMethods.NewSequentialId:
                case SystemMethods.NewGuid:
                    return "gen_uuid()";
                case SystemMethods.CurrentDateTime:
                    return "CURRENT_TIMESTAMP";
                case SystemMethods.CurrentUser:
                    return "CURRENT_USER";
                /*
                 Firebird v.3.0.4: Context variables LOCALTIME and LOCALTIMESTAMP were added as synonyms for CURRENT_TIME and CURRENT_TIMESTAMP, respectively, in anticipation of CURRENT_TIME and CURRENT_TIMESTAMP being redefined in Firebird 4 to represent the time and timestamp in UTC time, to comply with the SQL standards.
                 Source: https://firebirdsql.org/file/documentation/release_notes/html/en/3_0/bk02ch09s06.html


                 Source: https://github.com/FirebirdSQL/firebird/blob/master/doc/sql.extensions/README.time_zone.md#changes-in-current_time-and-current_timestamp
                 */
                case SystemMethods.CurrentDateTime:
                    return "LOCALTIMESTAMP";
                case SystemMethods.CurrentDateTimeOffset:
                    throw new ArgumentException($"{nameof(SystemMethods.CurrentDateTimeOffset)} not supported.");
                case SystemMethods.CurrentUTCDateTime:
                    return "CURRENT_TIMESTAMP";
            }

src\FluentMigrator.Runner.MySql\Generators\MySql\MySqlQuoter.cs

namespace FluentMigrator.Runner.Generators.MySql
@ -51,6 +53,8 @@ namespace FluentMigrator.Runner.Generators.MySql
                    return "UTC_TIMESTAMP";
                case SystemMethods.CurrentUser:
                    return "CURRENT_USER()";
                case SystemMethods.CurrentDateTimeOffset:
                    throw new ArgumentException($"{nameof(SystemMethods.CurrentDateTimeOffset)} not supported.");
            }

@jzabroski jzabroski added this to the 4.0.0 milestone May 3, 2022
@jzabroski jzabroski modified the milestones: 4.0.0, 5.0.0 Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant