Skip to content

Commit

Permalink
refactor(sql): automatically create sql tables
Browse files Browse the repository at this point in the history
  • Loading branch information
solareon committed Aug 28, 2024
1 parent 81102dc commit 0d9606a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
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`)
);
]=])

0 comments on commit 0d9606a

Please sign in to comment.