[DBIx-Class-Devel] [dbsrgits/sql-translator] Oracle producer add missing functions (PR #143)

hazardv notifications at github.com
Fri Sep 9 16:12:08 GMT 2022


@hazardv commented on this pull request.



> @@ -668,19 +655,20 @@ sub create_field {
         push @trigger_defs, $trigger;
     }
 
-    if ( lc $field->data_type eq 'timestamp' ) {
-        my $base_name = $table_name . "_". $field_name;
-        my $trig_name = quote(mk_name( $base_name, 'ts' ), $qt);
-        my $trigger =
-          "CREATE OR REPLACE TRIGGER $trig_name\n".
-          "BEFORE INSERT OR UPDATE ON $table_name_q\n".
-          "FOR EACH ROW WHEN (new.$field_name_q IS NULL)\n".
-          "BEGIN\n".
-          " SELECT sysdate INTO :new.$field_name_q FROM dual;\n".
-          "END;\n";
-
-          push @trigger_defs, $trigger;
-    }
+    # Do not create a trigger to insert sysdate to all timestamp fields
+    # if ( lc $field->data_type eq 'timestamp' ) {

I agree, I just wasn't sure how things were being handled on this project. I wanted that change and its reason to be obvious. I will get rid of that.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/dbsrgits/sql-translator/pull/143#discussion_r967245383
You are receiving this because you are subscribed to this thread.

Message ID: <dbsrgits/sql-translator/pull/143/review/1102573526 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class-devel/attachments/20220909/76fe3675/attachment.htm>


More information about the DBIx-Class-Devel mailing list