qbcore-framework / qb-management

Management menu for jobs & gangs
GNU General Public License v3.0
32 stars 162 forks source link

[BUG] database sql missing? #105

Closed FiZzontje closed 6 months ago

perpete1979 commented 7 months ago

I 'm sorry you dont give the sql ???

DeeRock94 commented 7 months ago

I'm sorry @perpete1979 but the documentation suggests:

Installation

Manual

  • Download the script and put it in the [qb] directory.
  • IF NEW SERVER: Import qb-management.sql in your database
  • IF EXISTING SERVER: Import qb-management_upgrade.sql in your database
  • Edit config.lua with coords
  • Restart Script / Server

Regardless if it's a NEW server or an EXISTING server, the qb-management.sql doesn't exist on this repo. Which is what @FiZzontje is highlighting. Did you find a solution to this?

robertxxiv commented 7 months ago

may i have the sql file ?

MaDHouSe79 commented 7 months ago

may i have the sql file ?

CREATE TABLE IF NOT EXISTS `management_funds` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `job_name` varchar(50) NOT NULL,
  `amount` int(100) NOT NULL,
  `type` enum('boss','gang') NOT NULL DEFAULT 'boss',
  PRIMARY KEY (`id`),
  UNIQUE KEY `job_name` (`job_name`),
  KEY `type` (`type`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
MatFirdaus33 commented 7 months ago

-- Use this if you are installing a new DB/Server (these are the default QB-Management jobs/gangs) CREATE TABLE IF NOT EXISTS management_funds ( id INT(11) NOT NULL AUTO_INCREMENT, job_name VARCHAR(50) NOT NULL, amount INT(100) NOT NULL, type ENUM('boss','gang') NOT NULL DEFAULT 'boss', PRIMARY KEY (id), UNIQUE KEY job_name (job_name), KEY type (type) );

INSERT INTO management_funds (job_name, amount, type) VALUES ('police', 0, 'boss'), ('ambulance', 0, 'boss'), ('realestate', 0, 'boss'), ('taxi', 0, 'boss'), ('cardealer', 0, 'boss'), ('mechanic', 0, 'boss'), ('lostmc', 0, 'gang'), ('ballas', 0, 'gang'), ('vagos', 0, 'gang'), ('cartel', 0, 'gang'), ('families', 0, 'gang'), ('triads', 0, 'gang');

MaDHouSe79 commented 7 months ago

-- Use this if you are installing a new DB/Server (these are the default QB-Management jobs/gangs) CREATE TABLE IF NOT EXISTS management_funds ( id INT(11) NOT NULL AUTO_INCREMENT, job_name VARCHAR(50) NOT NULL, amount INT(100) NOT NULL, type ENUM('boss','gang') NOT NULL DEFAULT 'boss', PRIMARY KEY (id), UNIQUE KEY job_name (job_name), KEY type (type) );

INSERT INTO management_funds (job_name, amount, type) VALUES ('police', 0, 'boss'), ('ambulance', 0, 'boss'), ('realestate', 0, 'boss'), ('taxi', 0, 'boss'), ('cardealer', 0, 'boss'), ('mechanic', 0, 'boss'), ('lostmc', 0, 'gang'), ('ballas', 0, 'gang'), ('vagos', 0, 'gang'), ('cartel', 0, 'gang'), ('families', 0, 'gang'), ('triads', 0, 'gang');

Thats even better 😄, i don't know why they remove this sql file from this resources. But on a fress install you mis this in the database and is not added when installing from TxAdmin and you get many errors. place the file back please cause it's needed for a new install and now you don't have it.

i think if a resource needs a database there sute be a database file in that resources, even if you have an exsisted server.

MatFirdaus33 commented 7 months ago

-- Use this if you are upgrading an existing DB/Server (this will copy your current bossmenu and gangmenu data to QB-Management jobs/gangs) CREATE TABLE IF NOT EXISTS management_funds ( id INT(11) NOT NULL AUTO_INCREMENT, job_name VARCHAR(50) NOT NULL, amount INT(100) NOT NULL, type ENUM('boss','gang') NOT NULL DEFAULT 'boss', PRIMARY KEY (id), UNIQUE KEY job_name (job_name), KEY type (type) );

-- First we do boss menu (THIS WILL PULL YOUR CURRENT bossmenu DATA AND ADD IT TO THE NEWLY CREATED TABLE) INSERT INTO management_funds (job_name, amount, type) SELECT job_name, amount, 'boss' FROM bossmenu;

-- [[ You can remove all of this if you want, this is just to confirm everything moved over correctly ]]-- SET @totalbossmenu = (SELECT COUNT() FROM bossmenu); SET @managemenu_boss = (SELECT COUNT() FROM management_funds WHERE type = 'boss');

SELECT CONCAT("TOTAL BOSS MENU: ", @totalbossmenu); SELECT CONCAT("TOTAL MANAGE MENU: ", @managemenu_boss);

-- Check that all of boss menu moved; DELIMITER $ BEGIN NOT ATOMIC IF @totalbossmenu = @managemenu_boss THEN SELECT CONCAT("CONGRATS, BOSS FULLY MOVED [You can delete bossmenu if you desire]", " "); ELSE SELECT CONCAT("UT OH, SOMETHING DID NOT WORK (BOSS) [Check what got moved and what didn't manually]", " "); END IF; END $ DELIMITER ; -- [[ end confirming all of bossmenu moved correctly ]]--

-- Lastly we do the gang menu (THIS WILL PULL YOUR CURRENT gangmenu DATA AND ADD IT TO THE NEWLY CREATED TABLE) INSERT INTO management_funds (job_name, amount, type) SELECT job_name, amount, 'gang' FROM gangmenu;

-- [[ You can remove all of this if you want, this is just to confirm everything moved over correctly ]]-- SET @totalgangmenu = (SELECT COUNT() FROM gangmenu); SET @managemenu_gang = (SELECT COUNT() FROM management_funds WHERE type = 'gang');

SELECT CONCAT("TOTAL GANG MENU: ", @totalgangmenu); SELECT CONCAT("TOTAL MANAGE GANG MENU: ", @managemenu_gang);

-- Check that all of gang menu moved; DELIMITER $ BEGIN NOT ATOMIC IF @totalgangmenu = @managemenu_gang THEN SELECT CONCAT("CONGRATS, GANG FULLY MOVED [You can delete gangmenu if you desire]", " "); ELSE SELECT CONCAT("UT OH, SOMETHING DID NOT WORK (GANG) [Check what got moved and what didn't manually]", " "); END IF; END $ DELIMITER ; -- [[ end confirming all of gangmenu moved correctly ]]--

GhzGarage commented 6 months ago

All job/gang accounts are done through the new qb-banking

cipher2310 commented 5 months ago

the new qb-banking sucks

IAmDanielPeter commented 2 months ago

agreed.