-
Notifications
You must be signed in to change notification settings - Fork 0
/
formd8v2.install
66 lines (61 loc) · 1.56 KB
/
formd8v2.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
use Drupal\Core\Database\Database;
function formd8v2_schema() {
$schema['form_1'] = array(
// Example (partial) specification for table "node".
'description' => 'The base table for forms.',
'fields' => array(
'id' => array(
'description' => 'The primary identifier for a form.',
'type' => 'serial',
'not null' => TRUE,
),
'first_name' => array(
'description' => 'The First name',
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
'default' => '',
),
'last_name' => array(
'description' => 'The last name',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'gender' => array(
'description' => 'The gender name',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'birth_date' => array(
'description' => 'The birth date',
'type' => 'int',
'length' => 127,
'not null' => TRUE,
),
'email' => array(
'description' => 'The email',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
),
'primary key' => array('id'),
);
return $schema;
}
function formd8v2_update_8001(){
$column = array(
'description' => 'fid',
'type' => 'int',
'length' => 20,
'not null' => FALSE,
);
$schema = Database::getConnection()->schema();
$schema ->addField('form_1','fid',$column);
}