history_user -> history_usernum
authorIvan Kohler <ivan@freeside.biz>
Fri, 17 May 2013 20:22:37 +0000 (13:22 -0700)
committerIvan Kohler <ivan@freeside.biz>
Fri, 17 May 2013 20:22:37 +0000 (13:22 -0700)
FS/FS/Record.pm
FS/FS/Schema.pm

index 3886c33..cdbcae0 100644 (file)
@@ -1907,10 +1907,10 @@ sub _h_statement {
   my @values = map { _quote( $self->getfield($_), $self->table, $_) } @fields;
 
   "INSERT INTO h_". $self->table. " ( ".
   my @values = map { _quote( $self->getfield($_), $self->table, $_) } @fields;
 
   "INSERT INTO h_". $self->table. " ( ".
-      join(', ', qw(history_date history_user history_action), @fields ).
+      join(', ', qw(history_date history_usernum history_action), @fields ).
     ") VALUES (".
       join(', ', $time,
     ") VALUES (".
       join(', ', $time,
-                 dbh->quote( $FS::CurrentUser::CurrentUser->username ),
+                 $FS::CurrentUser::CurrentUser->usernum,
                  dbh->quote($action),
                  @values
       ).
                  dbh->quote($action),
                  @values
       ).
index 1da302d..5f1611c 100644 (file)
@@ -267,12 +267,20 @@ sub dbdef_dist {
           DBIx::DBSchema::Column->new( {
             'name'    => 'history_user',
             'type'    => 'varchar',
           DBIx::DBSchema::Column->new( {
             'name'    => 'history_user',
             'type'    => 'varchar',
-            'null'    => 'NOT NULL',
+            'null'    => 'NULL',
             'length'  => '80',
             'default' => '',
             'local'   => '',
           } ),
           DBIx::DBSchema::Column->new( {
             'length'  => '80',
             'default' => '',
             'local'   => '',
           } ),
           DBIx::DBSchema::Column->new( {
+            'name'    => 'history_usernum',
+            'type'    => 'int',
+            'null'    => 'NULL',
+            'length'  => '',
+            'default' => '',
+            'local'   => '',
+          } ),
+          DBIx::DBSchema::Column->new( {
             'name'    => 'history_action',
             'type'    => 'varchar',
             'null'    => 'NOT NULL',
             'name'    => 'history_action',
             'type'    => 'varchar',
             'null'    => 'NOT NULL',