From: Anthony Talarico Date: Thu, 21 Sep 2017 14:56:02 +0000 (-0400) Subject: adding old_id columns for data import X-Git-Tag: v1.0.0~1^2~29 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=26df5e7ffb0d548e566fd4f6da25231b441f03c7;p=WP-Plugins%2Fglm-member-db-jobs.git adding old_id columns for data import adding a new colum for old_ids to accommodate the import --- diff --git a/classes/data/dataJobTitles.php b/classes/data/dataJobTitles.php index a1fc9e6..872063e 100644 --- a/classes/data/dataJobTitles.php +++ b/classes/data/dataJobTitles.php @@ -133,6 +133,12 @@ class GlmDataJobTitles extends GlmDataAbstract 'id' => array ( 'field' => 'id', 'type' => 'integer', + 'view_only' => true, + 'use' => 'a' + ), + 'old_id' => array ( + 'field' => 'old_id', + 'type' => 'integer', 'use' => 'a' ), 'job_title' => array ( diff --git a/classes/data/dataJobs.php b/classes/data/dataJobs.php index 1ea8dab..bdd4b5d 100644 --- a/classes/data/dataJobs.php +++ b/classes/data/dataJobs.php @@ -136,6 +136,11 @@ class GlmDataJobs extends GlmDataAbstract 'view_only' => true, 'use' => 'a' ), + 'old_id' => array ( + 'field' => 'old_id', + 'type' => 'integer', + 'use' => 'a' + ), 'title' => array ( 'field' => 'title', 'type' => 'pointer', @@ -179,6 +184,11 @@ class GlmDataJobs extends GlmDataAbstract 'type' => 'datetime', 'use' => 'lge' ), + 'updated' => array ( + 'field' => 'updated', + 'type' => 'datetime', + 'use' => 'a' + ), 'visible' => array ( 'field' => 'visible', 'type' => 'checkbox', @@ -232,6 +242,7 @@ class GlmDataJobs extends GlmDataAbstract 'type' => 'text', 'use' => 'a' ), + 'member' => array ( 'field' => 'member', 'type' => 'pointer', diff --git a/setup/databaseScripts/create_database_V0.0.1.sql b/setup/databaseScripts/create_database_V0.0.1.sql index a47e149..cb4d254 100644 --- a/setup/databaseScripts/create_database_V0.0.1.sql +++ b/setup/databaseScripts/create_database_V0.0.1.sql @@ -14,6 +14,7 @@ -- Conditions Table CREATE TABLE {prefix}jobs ( id INT NOT NULL AUTO_INCREMENT, + old_id int NULL , title int NULL , descr TEXT NULL , salary TINYTEXT NULL , @@ -22,6 +23,7 @@ CREATE TABLE {prefix}jobs ( contactname TINYTEXT NULL , contactphone TINYTEXT NULL , post_date DATETIME NULL DEFAULT NOW(), + updated DATETIME NULL DEFAULT NOW(), visible BOOL NULL, facility_operation TEXT NULL, requirements TEXT NULL, @@ -41,6 +43,7 @@ CREATE TABLE {prefix}jobs ( -- Job Titles CREATE TABLE {prefix}job_titles ( id INT NOT NULL AUTO_INCREMENT, + old_id INT NULL, job_title TINYTEXT NULL , PRIMARY KEY (id) ); @@ -48,17 +51,17 @@ CREATE TABLE {prefix}job_titles ( ---- -- Job Titles default entries in table -INSERT INTO {prefix}job_titles ( id,job_title) VALUES -(1, 'Supervisor'),(2,'Groundskeeper'),(3,'Janitor'); +INSERT INTO {prefix}job_titles ( id,old_id,job_title) VALUES +(1,1, 'Supervisor'),(2,1,'Groundskeeper'),(3,1,'Janitor'); ---- -- Job Titles default entries in table INSERT INTO {prefix}jobs ( -id,title,descr,salary, email_location,resume_location,contactname,contactphone,post_date,visible, +id,old_id,title,descr,salary, email_location,resume_location,contactname,contactphone,post_date,updated,visible, facility_operation,requirements,job_location,job_expiration,duration,deadline,position_available, company,member,benefits -) VALUES ( 1, 1,"DESCRIPTION",'SALARY', 'EMAIL LOCATION', 'RESUME LOCATION','CONTACT NAME', '453-3443', NOW(), true, +) VALUES ( 1,1, 1,"DESCRIPTION",'SALARY', 'EMAIL LOCATION', 'RESUME LOCATION','CONTACT NAME', '453-3443', NOW(),NOW(), true, 'facility operations', 'REQUIREMENTS', 'JOB LOCATION', 30, 'JOB DURATION', 'DEADLINE', 'POSITION AVAILABLE', 'COMPANY', 1, 'JOB BENEFITS' ); \ No newline at end of file diff --git a/views/admin/jobs/index.html b/views/admin/jobs/index.html index 280e007..7dbf365 100644 --- a/views/admin/jobs/index.html +++ b/views/admin/jobs/index.html @@ -22,7 +22,7 @@
{$data.title}
{$data.company}
-
MEMBER NAME
+
{$data.member}
{$data.post_date.timestamp|date_format:"%Y-%m-%d"}