Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(sql): automatically create sql tables #69

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
shopt -s extglob
mkdir -p ./temp/${{ github.event.repository.name }}
mkdir -p ./temp/${{ github.event.repository.name }}/web
cp ./{README.md,LICENSE,config.lua,fxmanifest.lua} ./temp/${{ github.event.repository.name }}
cp ./{README.md,LICENSE,config.lua,fxmanifest.lua,Renewed-Banking.sql} ./temp/${{ github.event.repository.name }}
cp -r ./{client,locales,server} ./temp/${{ github.event.repository.name }}
cp -r ./web/public ./temp/${{ github.event.repository.name }}/web/public
cd ./temp && zip -r ../${{ github.event.repository.name }}.zip ./${{ github.event.repository.name }}
Expand Down
21 changes: 20 additions & 1 deletion server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -658,4 +658,23 @@ function ExportHandler(resource, name, cb)
AddEventHandler(('__cfx_export_%s_%s'):format(resource, name), function(setCB)
setCB(cb)
end)
end
end

MySQL.query.await([=[
CREATE TABLE IF NOT EXISTS `bank_accounts_new` (
`id` varchar(50) NOT NULL,
`amount` int(11) DEFAULT 0,
`transactions` longtext DEFAULT '[]',
`auth` longtext DEFAULT '[]',
`isFrozen` int(11) DEFAULT 0,
`creator` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`)
);

CREATE TABLE IF NOT EXISTS `player_transactions` (
`id` varchar(50) NOT NULL,
`isFrozen` int(11) DEFAULT 0,
`transactions` longtext DEFAULT '[]',
PRIMARY KEY (`id`)
);
]=])
Loading