1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
2 SET time_zone = "+00:00";
4 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
5 /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
6 /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
7 /*!40101 SET NAMES utf8 */;
10 DROP TABLE IF EXISTS `contacts`;
11 CREATE TABLE IF NOT EXISTS `contacts` (
12 `id` bigint(20) unsigned NOT NULL COMMENT 'Primary key',
13 `own_contact` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Whether own contact',
14 `gender` varchar(10) NOT NULL DEFAULT 'UNKNOWN' COMMENT 'Gender',
15 `surname` varchar(100) NOT NULL COMMENT 'Surname',
16 `family_name` varchar(100) NOT NULL COMMENT 'Family name',
17 `company_name` varchar(255) DEFAULT NULL COMMENT 'Company name',
18 `street` varchar(255) DEFAULT NULL COMMENT 'Street name',
19 `house_number` smallint(5) unsigned DEFAULT NULL COMMENT 'House number',
20 `city` varchar(100) DEFAULT NULL COMMENT 'City name',
21 `zip_code` smallint(5) unsigned DEFAULT NULL COMMENT 'ZIP code',
22 `country_code` char(2) DEFAULT NULL COMMENT 'Country code',
23 `phone_number` varchar(100) DEFAULT NULL COMMENT 'Phone number',
24 `cellphone_number` varchar(100) DEFAULT NULL COMMENT 'Cellphone number',
25 `fax_number` varchar(100) DEFAULT NULL COMMENT 'Fax number',
26 `email_address` varchar(100) DEFAULT NULL COMMENT 'Email addres',
27 `birthday` date DEFAULT NULL COMMENT 'Birth day',
28 `comment` tinytext NOT NULL COMMENT 'Comment',
29 `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Entry created',
30 `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP
31 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Contacts data' AUTO_INCREMENT=1 ;
34 ALTER TABLE `contacts`
35 ADD PRIMARY KEY (`id`);
38 ALTER TABLE `contacts`
39 MODIFY `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Primary key';
40 /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
41 /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
42 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;