0

Hello so I've exported this from a server where it worked perfectly fine and I looked up this error

#1101 - BLOB/TEXT column 'bought_furniture' can't have a default value

but can't find any useful sources of fixes, the database is only having a hard time importing this table.

CREATE TABLE IF NOT EXISTS `users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `identifier` varchar(50) COLLATE utf8mb4_bin NOT NULL,
  `license` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL,
  `money` int(11) DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_bin DEFAULT '',
  `skin` longtext COLLATE utf8mb4_bin DEFAULT NULL,
  `job` varchar(255) COLLATE utf8mb4_bin DEFAULT 'unemployed',
  `job_grade` int(11) DEFAULT 0,
  `loadout` longtext COLLATE utf8mb4_bin DEFAULT NULL,
  `position` varchar(256) COLLATE utf8mb4_bin DEFAULT '{"x":195.55,"y":-933.36,"z":29.90,"heading":100.0}',
  `bank` int(11) DEFAULT NULL,
  `permission_level` int(11) DEFAULT NULL,
  `group` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL,
  `is_dead` tinyint(1) DEFAULT 0,
  `firstname` varchar(50) COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  `lastname` varchar(50) COLLATE utf8mb4_bin DEFAULT '',
  `dateofbirth` varchar(25) COLLATE utf8mb4_bin DEFAULT '',
  `sex` varchar(10) COLLATE utf8mb4_bin DEFAULT '',
  `height` varchar(5) COLLATE utf8mb4_bin DEFAULT '',
  `status` longtext COLLATE utf8mb4_bin DEFAULT NULL,
  `phone_number` varchar(10) COLLATE utf8mb4_bin DEFAULT NULL,
  `jail` int(11) NOT NULL DEFAULT 0,
  `house` longtext COLLATE utf8mb4_bin NOT NULL DEFAULT '{"owns":false,"furniture":[],"houseId":0}',
  `bought_furniture` longtext COLLATE utf8mb4_bin NOT NULL DEFAULT '{}',
  `last_house` int(11) DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=117 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

If someone could help me that would be wonderful.

Barmar
  • 741,623
  • 53
  • 500
  • 612
Tarvik
  • 1
  • What exactly do you need help with? Removing the `NOT NULL DEFAULT '{}'` from the column definition, or writing a BEFORE INSERT trigger? Modifying an INSERT statement to provide '{}' as a value for the column? – spencer7593 Mar 16 '20 at 18:29
  • 1
    `but can't find any useful sources of fixes` Curious, Google gives me several pages of specific resources solving this specific issue, including posts on SO. – Martin Mar 16 '20 at 18:30
  • @spencer7593 Well I have no experience with MySQL and just had issues importing it into a database sorry if I say I don't really understand that. – Tarvik Mar 16 '20 at 19:19

0 Answers0