πŸ› οΈInstallation

Database

Before you install this database code, you can active the option `Config.AutoDatabaseSetup` to run this for you.

CREATE TABLE IF NOT EXISTS `farming_animals` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `land_id` int(11) NOT NULL,
  `owner` varchar(60) NOT NULL,
  `animal_type` varchar(50) DEFAULT NULL,
  `health` int(11) DEFAULT 100,
  `hunger` int(11) DEFAULT 100,
  `thirst` int(11) DEFAULT 0,
  `hygiene` int(11) DEFAULT 100,
  `production_ready` tinyint(1) DEFAULT 0,
  `durability` int(11) DEFAULT 100,
  `max_durability` int(11) DEFAULT 100,
  `last_decay` bigint(20) DEFAULT NULL,
  `last_production` bigint(20) DEFAULT NULL,
  `last_collected` timestamp NULL DEFAULT current_timestamp(),
  `x` float DEFAULT NULL,
  `y` float DEFAULT NULL,
  `z` float DEFAULT NULL,
  `heading` float DEFAULT NULL,
  `last_fed` timestamp NULL DEFAULT current_timestamp(),
  `placed_at` timestamp NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `owner` (`owner`),
  KEY `land_id` (`land_id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

CREATE TABLE IF NOT EXISTS `farming_contracts` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `owner` varchar(50) NOT NULL,
  `contract_id` varchar(50) NOT NULL,
  `items_required` longtext NOT NULL,
  `reward_money` int(11) NOT NULL DEFAULT 0,
  `reward_items` longtext DEFAULT NULL,
  `delivery_location` longtext NOT NULL,
  `status` enum('active','completed','expired','cancelled') DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `expires_at` timestamp NULL DEFAULT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `owner_idx` (`owner`),
  KEY `status_idx` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;

CREATE TABLE IF NOT EXISTS `farming_decorations` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `land_id` int(11) NOT NULL,
  `owner` varchar(60) NOT NULL,
  `decoration_id` varchar(50) NOT NULL,
  `x` float NOT NULL,
  `y` float NOT NULL,
  `z` float NOT NULL,
  `heading` float NOT NULL DEFAULT 0,
  `placed_at` timestamp NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `owner` (`owner`),
  KEY `land_id` (`land_id`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE IF NOT EXISTS `farming_inventory` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `land_id` int(11) NOT NULL,
  `owner` varchar(60) NOT NULL,
  `items` longtext DEFAULT '{}',
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_inventory` (`land_id`,`owner`),
  KEY `owner` (`owner`),
  KEY `land_id` (`land_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

CREATE TABLE IF NOT EXISTS `farming_lands` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `land_id` int(11) NOT NULL,
  `owner` varchar(60) NOT NULL,
  `co_owners` longtext DEFAULT '[]',
  `purchase_date` timestamp NULL DEFAULT current_timestamp(),
  `upgrade_level` int(11) DEFAULT 0,
  `upgrades` longtext DEFAULT '{}',
  `total_earned` int(11) DEFAULT 0,
  `total_spent` int(11) DEFAULT 0,
  `plants_harvested` int(11) DEFAULT 0,
  `products_collected` int(11) DEFAULT 0,
  `contracts_completed` int(11) DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `owner` (`owner`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

CREATE TABLE IF NOT EXISTS `farming_plants` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `land_id` int(11) NOT NULL,
  `slot_id` int(11) NOT NULL,
  `owner` varchar(60) NOT NULL,
  `plant_type` varchar(50) DEFAULT NULL,
  `stage` int(11) DEFAULT 1,
  `health` int(11) DEFAULT 100,
  `water` int(11) DEFAULT 100,
  `fertilizer` int(11) DEFAULT 100,
  `x` float DEFAULT NULL,
  `y` float DEFAULT NULL,
  `z` float DEFAULT NULL,
  `heading` float DEFAULT NULL,
  `planted_at` timestamp NULL DEFAULT current_timestamp(),
  `ready_at` timestamp NULL DEFAULT NULL,
  `last_decay` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `owner` (`owner`),
  KEY `land_id` (`land_id`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

CREATE TABLE IF NOT EXISTS `farming_reputation` (
  `owner` varchar(50) NOT NULL,
  `reputation` int(11) NOT NULL DEFAULT 0,
  `contracts_completed` int(11) NOT NULL DEFAULT 0,
  `contracts_failed` int(11) NOT NULL DEFAULT 0,
  `last_refresh` timestamp NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`owner`),
  KEY `reputation_idx` (`reputation`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;

CREATE TABLE IF NOT EXISTS `farming_offline_shops` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `farm_id` int(11) NOT NULL,
  `owner` varchar(60) NOT NULL,
  `shop_name` varchar(100) NOT NULL,
  `npc_model` varchar(50) NOT NULL DEFAULT 'a_m_m_farmer_01',
  `coords` longtext NOT NULL,
  `items` longtext DEFAULT '[]',
  `balance` int(11) DEFAULT 0,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_farm_shop` (`farm_id`),
  KEY `owner` (`owner`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

Items

Last updated