text: CREATE TABLE location (
  	lat DECIMAL(8,6)
  	lng DECIMAL(9,6) 
  	uuid BINARY(16) NOT NULL,
  	title VARCHAR(255) NOT NULL,
  
  	created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  	updated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  	
  	PRIMARY KEY (uuid)
  );
  
  CREATE TABLE friend (
  	uuid BINARY(16) NOT NULL,
  	origin BINARY(16) NOT NULL,
  	target BINARY(16) NOT NULL,
  	approved TINYINT(1) NOT NULL DEFAULT 0,
  
  	created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  	updated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  	
  	PRIMARY KEY (uuid),
  	FOREIGN KEY (origin) REFERENCES person(uuid),
  	FOREIGN KEY (target) REFERENCES person(uuid)
  	UNIQUE KEY (origin, target)
  );
  
  CREATE TABLE machine (
  	uuid BINARY(16) NOT NULL,
  	image BINARY(16),
  
  	time SMALLINT,
  	reps SMALLINT,
  	sets SMALLINT,
  	
  	title VARCHAR(255) NOT NULL,
  	
  	created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  	updated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  	
  	PRIMARY KEY (uuid)
  );
  
  CREATE TABLE person (
  	uuid BINARY(16) NOT NULL,
  	name VARCHAR(255) NOT NULL,
  	email VARCHAR(255) NOT NULL,
  	photo VARCHAR(2083) NOT NULL,
  
  	created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  	updated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  	
  	PRIMARY KEY (uuid),
  	CONSTRAINT email UNIQUE (email)
  );
  
  CREATE TABLE schedule (
  	uuid BINARY(16) NOT NULL,
  	
  	day SMALLINT NOT NULL,
  	person BINARY(16) NOT NULL,
  	machine BINARY(16) NOT NULL,
  	
  	created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  	updated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  
  	PRIMARY KEY (uuid),
  	FOREIGN KEY (person) REFERENCES person(uuid),
  	FOREIGN KEY (machine) REFERENCES machine(uuid)
  );
  
  CREATE TABLE entry (
  	uuid BINARY(16) NOT NULL,
  	person BINARY(16) NOT NULL,
  	machine BINARY(16) NOT NULL,
  	location BINARY(16) NOT NULL,
  
  	speed SMALLINT,
  	weight SMALLINT,
  	upgrade TINYINT(1) NOT NULL DEFAULT 0,
  	
  	created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  	updated TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  	
  	PRIMARY KEY (uuid),
  	FOREIGN KEY (person) REFERENCES person(uuid),
  	FOREIGN KEY (machine) REFERENCES machine(uuid),
  	FOREIGN KEY (location) REFERENCES location(uuid)
  );
  
  ENGINE=InnoDB
  DEFAULT CHARSET=utf8mb4
  COLLATE=utf8mb4_0900_ai_ci;