 INSERT INTO `abac_policy_rules_attributes` (`policy_rule_id`, `attribute_id`, `type`, `comparison_type`, `comparison`, `value`) VALUES (2, 7, 'object', 'Array', 'isIn', 'a:5:{i:0;s:2:"FR";i:1;s:2:"DE";i:2;s:2:"IT";i:3;s:1:"L";i:4;s:2:"GB";}');
 INSERT INTO `abac_policy_rules_attributes` (`policy_rule_id`, `attribute_id`, `type`, `comparison_type`, `comparison`, `value`) VALUES (2, 8, 'object', 'Numeric', 'isEqual', 'dynamic');
 INSERT INTO `abac_policy_rules_attributes` (`policy_rule_id`, `attribute_id`, `type`, `comparison_type`, `comparison`, `value`) VALUES (2, 9, 'environment', 'String', 'isEqual', 'OPEN');
-
-INSERT INTO `abac_test_user` (`id`, `name`, `age`, `parent_nationality`, `has_done_japd`, `has_driving_license`) VALUES (1, 'John Doe', 36, 'FR', 1, 1);
-INSERT INTO `abac_test_user` (`id`, `name`, `age`, `parent_nationality`, `has_done_japd`, `has_driving_license`) VALUES (2, 'Thierry', 24, 'FR', 0, 0);
-INSERT INTO `abac_test_user` (`id`, `name`, `age`, `parent_nationality`, `has_done_japd`, `has_driving_license`) VALUES (3, 'Jason', 17, 'FR', 1, 1);
-INSERT INTO `abac_test_user` (`id`, `name`, `age`, `parent_nationality`, `has_done_japd`, `has_driving_license`) VALUES (4, 'Bouddha', 556, 'FR', 1, 0);
-
-INSERT INTO `abac_test_vehicle` (`id`, `user_id`, `brand`, `model`, `technical_review_date`, `manufacture_date`, `origin`, `engine_type`, `eco_class`) VALUES (1, 1, 'Renault', 'Mégane', '2014-08-19 11:03:38', '2015-08-19 11:03:38', 'FR', 'diesel', 'C');
-INSERT INTO `abac_test_vehicle` (`id`, `user_id`, `brand`, `model`, `technical_review_date`, `manufacture_date`, `origin`, `engine_type`, `eco_class`) VALUES (2, 3, 'Fiat', 'Stilo', '2008-08-19 11:03:38', '2004-08-19 11:03:38', 'IT', 'diesel', 'C');
-INSERT INTO `abac_test_vehicle` (`id`, `user_id`, `brand`, `model`, `technical_review_date`, `manufacture_date`, `origin`, `engine_type`, `eco_class`) VALUES (3, 1, 'Alpha Roméo', 'Mito', '2014-08-19 11:03:38', '2013-08-19 11:03:38', 'FR', 'gasoline', 'D');
-INSERT INTO `abac_test_vehicle` (`id`, `user_id`, `brand`, `model`, `technical_review_date`, `manufacture_date`, `origin`, `engine_type`, `eco_class`) VALUES (4, 4, 'Fiat', 'Punto', '2015-08-19 11:03:38', '2010-08-19 11:03:38', 'FR', 'diesel', 'B');

  FOREIGN KEY(attribute_id) REFERENCES abac_attributes_data(id)
);

CREATE TABLE IF NOT EXISTS `abac_test_user` (
  `id` integer PRIMARY KEY AUTOINCREMENT,
  `name` varchar(60) NOT NULL,
  `age` tinyint(4) NOT NULL,
  `parent_nationality` varchar(50) NOT NULL,
  `has_done_japd` tinyint(1) NOT NULL,
  `has_driving_license` tinyint(1) NOT NULL
);

CREATE TABLE IF NOT EXISTS `abac_test_vehicle` (
  `id` integer PRIMARY KEY AUTOINCREMENT,
  `user_id` int(11) NOT NULL,
  `brand` varchar(40) NOT NULL,
  `model` varchar(60) NOT NULL,
  `technical_review_date` datetime NOT NULL,
  `manufacture_date` datetime NOT NULL,
  `origin` varchar(50) NOT NULL,
  `engine_type` varchar(15) NOT NULL,
  `eco_class` varchar(1) NOT NULL
) ;

INSERT INTO `abac_policy_rules` (`id`, `name`, `created_at`, `updated_at`) VALUES (1, 'nationality-access', '2015-08-14 13:51:06', '2015-08-14 13:51:06');
INSERT INTO `abac_policy_rules` (`id`, `name`, `created_at`, `updated_at`) VALUES (2, 'vehicle-homologation', '2015-07-27 05:45:00', '2015-07-27 05:45:00');
INSERT INTO `abac_policy_rules` (`id`, `name`, `created_at`, `updated_at`) VALUES (3, 'gunlaw', '2015-08-16 16:21:10', '2015-08-16 16:21:10');


CREATE TABLE IF NOT EXISTS `abac_attributes` (
  `id` integer PRIMARY KEY AUTOINCREMENT,
  `property` varchar(40) NOT NULL,
  FOREIGN KEY(id) REFERENCES abac_attributes_data(id)
);

