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

Editing the database. #209

Closed
theclanbaymis opened this issue Nov 12, 2022 · 5 comments
Closed

Editing the database. #209

theclanbaymis opened this issue Nov 12, 2022 · 5 comments

Comments

@theclanbaymis
Copy link

theclanbaymis commented Nov 12, 2022

how can i edit the database?

i need help

Unhandled Rejection at: Promise Promise {
Error: relation "accounts" does not exist
at Object.generic (/game/swordbattle.io-main/node_modules/postgres/lib/types.js:200:5)
at Object.ErrorResponse (/game/swordbattle.io-main/node_modules/postgres/lib/backend.js:124:33)
at TLSSocket.data (/game/swordbattle.io-main/node_modules/postgres/lib/connection.js:167:25)
at TLSSocket.emit (node:events:527:28)
at addChunk (node:internal/streams/readable:315:12)
at readableAddChunk (node:internal/streams/readable:289:9)
at TLSSocket.Readable.push (node:internal/streams/readable:228:10)
at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23) {
severity_local: 'ERROR',
severity: 'ERROR',
code: '42P01',
file: 'errors.go',
line: '161',
routine: 'NewUndefinedRelationError'
}

@codergautam
Copy link
Owner

codergautam commented Nov 12, 2022

Hi, did you set up the database with all the tables correctly?

You can find instructions here:
https://iogames.forum/t/integrating-database-to-swordbattle-v1-code/13458

@theclanbaymis
Copy link
Author

ty, one quetion more.
how add this database in cockroachlabs.cloud?

@codergautam
Copy link
Owner

You can do that by creating and account and there is an option to make a database.

@theclanbaymis
Copy link
Author

You can do that by creating and account and there is an option to make a database.

yes i make a database, but how add this

CREATE TABLE public.accounts (
  skins jsonb NULL,
  password text NOT NULL,
  secret text NOT NULL,
  email text NULL,
  username text NOT NULL,
  created_at timestamp without time zone NOT NULL DEFAULT now(),
  id serial NOT NULL,
  lastusernamechange timestamp(6) without time zone NULL
);
ALTER TABLE
  public.accounts
ADD
  CONSTRAINT accounts_pkey PRIMARY KEY (id)

@codergautam
Copy link
Owner

codergautam commented Nov 14, 2022

You can connect to the database any way you like, it could be using terminal or a GUI client. I use Beekeeper Studio
Then you run those query which creates the tables which is required for swordbattle.

Closing because this is getting out of scope of this project.

@codergautam codergautam closed this as not planned Won't fix, can't repro, duplicate, stale Nov 14, 2022
@codergautam codergautam changed the title how edit database? Editing the database. Nov 19, 2022
@codergautam codergautam pinned this issue Nov 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants