| 1 |
<?php |
| 2 |
|
| 3 |
|
| 4 |
namespace JFB_Modules\Form_Record\Models; |
| 5 |
|
| 6 |
use JFB_Modules\Form_Record\Constraints\Record_Model_Constraint; |
| 7 |
use Jet_Form_Builder\Db_Queries\Base_Db_Model; |
| 8 |
use Jet_Form_Builder\Migrations\Versions\Version_2_1_0; |
| 9 |
use Jet_Form_Builder\Migrations\Versions\Version_2_1_8; |
| 10 |
use Jet_Form_Builder\Migrations\Versions\Version_3_6_1; |
| 11 |
|
| 12 |
// If this file is called directly, abort. |
| 13 |
if ( ! defined( 'WPINC' ) ) { |
| 14 |
die; |
| 15 |
} |
| 16 |
|
| 17 |
class Record_Action_Result_Model extends Base_Db_Model { |
| 18 |
|
| 19 |
public static function table_name(): string { |
| 20 |
return 'records_actions'; |
| 21 |
} |
| 22 |
|
| 23 |
public static function schema(): array { |
| 24 |
return array( |
| 25 |
'id' => 'bigint(20) NOT NULL AUTO_INCREMENT', |
| 26 |
'record_id' => 'bigint(20) NOT NULL', |
| 27 |
'action_slug' => 'varchar(255) NOT NULL', |
| 28 |
'action_id' => 'int(11) NOT NULL', |
| 29 |
'action_name' => 'varchar(255) NULL DEFAULT NULL', |
| 30 |
'on_event' => 'varchar(155) NULL DEFAULT \'DEFAULT.PROCESS\'', |
| 31 |
'status' => 'varchar(255) NOT NULL', |
| 32 |
'created_at' => 'TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP', |
| 33 |
'updated_at' => 'TIMESTAMP', |
| 34 |
); |
| 35 |
} |
| 36 |
|
| 37 |
public static function schema_keys(): array { |
| 38 |
return array( |
| 39 |
'id' => 'primary key', |
| 40 |
'record_id' => 'index', |
| 41 |
); |
| 42 |
} |
| 43 |
|
| 44 |
public function foreign_relations(): array { |
| 45 |
return array( |
| 46 |
new Record_Model_Constraint(), |
| 47 |
); |
| 48 |
} |
| 49 |
|
| 50 |
public function related_migrations(): array { |
| 51 |
return array( |
| 52 |
new Version_2_1_0(), |
| 53 |
new Version_2_1_8(), |
| 54 |
new Version_3_6_1(), |
| 55 |
); |
| 56 |
} |
| 57 |
} |
| 58 |
|