CREATE TABLE `items` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `aasm_state` varchar(255) DEFAULT NULL,
  `barcode` varchar(255) DEFAULT NULL,
  `description` text,
  `active` tinyint(1) DEFAULT '0',
  `sort_order` int(11) DEFAULT '0',
  `condition_type_id` int(11) DEFAULT NULL,
  `condition_details` text,
  `shippable` tinyint(1) DEFAULT '1',
  `shipping_weight` decimal(10,3) DEFAULT NULL,
  `rate_inherited_from` varchar(255) DEFAULT NULL,
  `commission_type_id` int(11) DEFAULT '1',
  `commission_rate` decimal(5,2) DEFAULT '35.00',
  `delta` tinyint(1) NOT NULL DEFAULT '1',
  `sale_id` int(11) DEFAULT NULL,
  `seller_id` int(11) DEFAULT NULL,
  `sale_ends_at` datetime DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime(6) DEFAULT NULL,
  `bids_count` int(11) DEFAULT '0',
  `following_users_count` int(11) DEFAULT '0',
  `buyer_invoice_id` int(11) DEFAULT NULL,
  `expected_sale_price` int(11) DEFAULT '0',
  `fragile` tinyint(1) DEFAULT '0',
  `lot_size` int(11) DEFAULT '1',
  `seller_invoice_id` int(11) DEFAULT NULL,
  `weight` decimal(10,3) DEFAULT NULL,
  `width` decimal(10,3) DEFAULT NULL,
  `height` decimal(10,3) DEFAULT NULL,
  `depth` decimal(10,3) DEFAULT NULL,
  `measurement_details` text,
  `close_order` int(11) DEFAULT '0',
  `attachments_count` int(11) DEFAULT '0',
  `cached_completeness_score` decimal(10,3) DEFAULT '0.000',
  `warehouse_pickup` tinyint(1) DEFAULT '0',
  `warehouse_fee` int(11) DEFAULT NULL,
  `taxable` tinyint(1) DEFAULT '1',
  `extended` tinyint(1) DEFAULT '0',
  `location` varchar(255) DEFAULT NULL,
  `high_bid_amount` int(11) DEFAULT '0',
  `disclaimer` text,
  `classification_value` int(11) DEFAULT NULL,
  `original_sale_ends_at` datetime DEFAULT NULL,
  `nlg_source` int(11) DEFAULT NULL,
  `origin_type` int(11) DEFAULT NULL,
  `yank_reason` text,
  `able_to_pickup_at_dc` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_items_on_sale_id` (`sale_id`),
  KEY `index_items_on_buyer_invoice_id` (`buyer_invoice_id`),
  KEY `index_items_on_seller_id` (`seller_id`),
  KEY `index_items_on_seller_invoice_id` (`seller_invoice_id`),
  KEY `index_items_on_sort_order` (`sort_order`),
  KEY `sort_order_asc_items` (`sort_order`) USING BTREE,
  KEY `index_items_on_active_and_aasm_state` (`active`,`aasm_state`),
  KEY `index_items_on_barcode` (`barcode`),
  KEY `index_items_on_delta` (`delta`),
  KEY `index_items_on_cached_completeness_score` (`cached_completeness_score`),
  KEY `idx_items_on_active_aasm_state_bids_count` (`active`,`aasm_state`,`bids_count`)
) ENGINE=InnoDB AUTO_INCREMENT=5166011 DEFAULT CHARSET=utf8
