fix use of reserved sql word in dsl_note schema, RT7111/RT10806
authorlevinse <levinse>
Fri, 3 Dec 2010 23:38:27 +0000 (23:38 +0000)
committerlevinse <levinse>
Fri, 3 Dec 2010 23:38:27 +0000 (23:38 +0000)
FS/FS/Schema.pm
FS/FS/dsl_note.pm
FS/FS/part_export/ikano.pm
etc/sql-reserved-words.txt

index 5f78b51..7cccc7f 100644 (file)
@@ -1871,7 +1871,7 @@ sub tables_hashref {
       'columns' => [
         'notenum',           'serial',    '',        '', '', '',
        'svcnum',     'int', '',       '', '', '',
-        'user',     'varchar', 'NULL', $char_d,  '', '',
+        'author',     'varchar', 'NULL', $char_d,  '', '',
         'priority',   'char', 'NULL',       1,  '', '', 
        '_date',     'int', 'NULL',       '', '', '',
        'note',     'text', '',       '', '', '',
index 0155cbd..832fced 100644 (file)
@@ -34,7 +34,7 @@ FS::Record.  The following fields are currently supported:
 
 =item svcnum - the DSL for this note, see L<FS::svc_dsl>
 
-=item user - export-specific, e.g. note's author or ISP vs. telco/vendor
+=item author - export-specific, e.g. note's author or ISP vs. telco/vendor
 
 =item priority - export-specific, e.g. high priority or not; not used by most
 
@@ -105,7 +105,7 @@ sub check {
   my $error = 
     $self->ut_numbern('notenum')
     || $self->ut_foreign_key('svcnum', 'svc_dsl', 'svcnum')
-    || $self->ut_textn('user')
+    || $self->ut_textn('author')
     || $self->ut_alphasn('priority')
     || $self->ut_numbern('_date')
     || $self->ut_text('note')
index 6316b29..bae683a 100644 (file)
@@ -250,7 +250,7 @@ sub ikano2fsnote {
 
     new FS::dsl_note( {
        'svcnum' => $svcnum,
-       'user' => $by,
+       'author' => $by,
        'priority' => $n->{'HighPriority'} eq 'false' ? 'N' : 'H',
        '_date' => int(str2time($n->{'Date'})),
        'note' => $n->{'Text'},
index 89dea74..553eda2 100644 (file)
@@ -1,3 +1,9 @@
+The data below is wrong/incomplete, see:
+PG8.3 - http://www.postgresql.org/docs/8.3/static/sql-keywords-appendix.html
+MySQL5.6 - http://dev.mysql.com/doc/refman/5.6/en/reserved-words.html
+-------------------------------------------------------------------------------
+
+
 From http://epoch.cs.berkeley.edu:8000/sequoia/dba/montage/FAQ/SQL.html
   by Jean Anderson (jta@postgres.berkeley.edu)