Fix sql error found by Demian Katz.
authorrsoulliere <robert.soulliere@mohawkcollege.ca>
Mon, 18 Apr 2011 13:50:31 +0000 (09:50 -0400)
committerrsoulliere <robert.soulliere@mohawkcollege.ca>
Mon, 18 Apr 2011 13:50:31 +0000 (09:50 -0400)
1.6/admin/migratingdata_1.6.xml
2.0/admin/migratingdata_2.0.xml

index 4558d06..00c4d61 100644 (file)
@@ -499,6 +499,16 @@ CREATE TABLE students (
                                table.</para>           \r
                        </step>\r
                        <step>\r
+                               <para>Copy records into staging table from a comma delimited file.</para>\r
+<programlisting language="sql">\r
+COPY students (student_id, last_name, first_name, email, address_type, street1, street2, city, province, country, postal_code, phone, password) \r
+       FROM '/home/opensrf/patrons.csv' \r
+               WITH CSV HEADER;  \r
+</programlisting>\r
+                               <para>The above script wil vary depending on the format of your patron load file (<filename>patrons.csv</filename>). You may want to review \r
+                               <link xl:href="http://www.postgresql.org/docs/9.0/static/sql-copy.html" xl:title="PostgreSQL - COPY">PostgreSQL documentation</link></para>  \r
+                       </step>\r
+                       <step>\r
                                <para>Formatting of some fields to fit Evergreen filed formatting may be required. Here is an example of sql to adjust phone numbers in the staging \r
                                table to fit the evergreen field:</para>\r
 <programlisting language="sql">\r
@@ -507,13 +517,17 @@ substring(phone from 10), '(', ''), ')', ''), ' ', '-');
 </programlisting>\r
                                <para>Data <quote>massaging</quote> may be required to fit formats used in Evergreen.</para>\r
                        </step>\r
+                       \r
+\r
+\r
+\r
                        <step>\r
                                <para>Insert records from the staging table into the <link linkend="actor.table.usr">actor.usr</link> Evergreen table:</para>\r
 <programlisting language="sql">\r
  INSERT INTO actor.usr (\r
        profile, usrname, email, passwd, ident_type, ident_value, first_given_name, \r
        family_name, day_phone, home_ou, claims_returned_count, net_access_level) \r
-       SELECT profile, students.usrname, email, student_id, ident_type, student_id, \r
+       SELECT profile, students.usrname, email, password, ident_type, student_id, \r
        first_name, last_name, phone, home_ou, claims_returned_count, net_access_level \r
        FROM students;\r
 </programlisting>                      \r
@@ -596,7 +610,7 @@ CREATE TABLE students (
 \r
 \r
 --Copy records from your import text file\r
-COPY students (student_id, last_name, first_name, email, address_type, street1, street2, city, province, country, postal_code, phone) \r
+COPY students (student_id, last_name, first_name, email, address_type, street1, street2, city, province, country, postal_code, phone, password\r
        FROM '/home/opensrf/patrons.csv' \r
                WITH CSV HEADER;  \r
 \r
@@ -604,7 +618,7 @@ COPY students (student_id, last_name, first_name, email, address_type, street1,
 INSERT INTO actor.usr (\r
        profile, usrname, email, passwd, ident_type, ident_value, first_given_name, family_name, \r
        day_phone, home_ou, claims_returned_count, net_access_level) \r
-       SELECT profile, students.usrname, email, student_id, ident_type, student_id, first_name, \r
+       SELECT profile, students.usrname, email, password, ident_type, student_id, first_name, \r
        last_name, phone, home_ou, claims_returned_count, net_access_level FROM students;\r
 \r
 --Insert records from the staging table into the actor.usr table.\r
index 3b4c5a6..6f5f5ab 100644 (file)
@@ -517,7 +517,7 @@ substring(phone from 10), '(', ''), ')', ''), ' ', '-');
  INSERT INTO actor.usr (\r
        profile, usrname, email, passwd, ident_type, ident_value, first_given_name, \r
        family_name, day_phone, home_ou, claims_returned_count, net_access_level) \r
-       SELECT profile, students.usrname, email, student_id, ident_type, student_id, \r
+       SELECT profile, students.usrname, email, password, ident_type, student_id, \r
        first_name, last_name, phone, home_ou, claims_returned_count, net_access_level \r
        FROM students;\r
 </programlisting>              \r
@@ -588,7 +588,7 @@ CREATE TABLE students (
 ); \r
 \r
 --Copy records from your import text file\r
-COPY students (student_id, last_name, first_name, email, address_type, street1, street2, city, province, country, postal_code, phone) \r
+COPY students (student_id, last_name, first_name, email, address_type, street1, street2, city, province, country, postal_code, phone, password\r
        FROM '/home/opensrf/patrons.csv' \r
                WITH CSV HEADER;  \r
 \r
@@ -597,7 +597,7 @@ COPY students (student_id, last_name, first_name, email, address_type, street1,
 INSERT INTO actor.usr (\r
        profile, usrname, email, passwd, ident_type, ident_value, first_given_name, family_name, \r
        day_phone, home_ou, claims_returned_count, net_access_level) \r
-       SELECT profile, students.usrname, email, student_id, ident_type, student_id, first_name, \r
+       SELECT profile, students.usrname, email, password, ident_type, student_id, first_name, \r
        last_name, phone, home_ou, claims_returned_count, net_access_level FROM students;\r
 \r
 --Insert records from the staging table into the actor.usr table.\r