generate a postgres user table query with id,token,type,createdAt and user_id(foreign…
- User
generate a postgres user table query with id,token,type,createdAt and user_id(foreign key referenced from users table)
- Assistant
Here's a sample PostgreSQL query to create a user table with an id, token, type, createdAt, and user_id as a foreign key referencing the users table:
CREATE TABLE users ( id SERIAL PRIMARY KEY, username VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, createdAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP ); CREATE TABLE user_tokens ( id SERIAL PRIMARY KEY, token VARCHAR(255) NOT NULL, type VARCHAR(255) NOT NULL, createdAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP, user_id INT REFERENCES users(id) );In this example, there are two tables:
usersanduser_tokens. Theuserstable has columns forid,username,email,password, andcreatedAt. Theidcolumn is the primary key, and thecreatedAtcolumn has a default value set to the current timestamp.The
user_tokenstable has columns forid,token,type,createdAt, and . The column is the primary key, and the column has a default value set to the current timestamp. The column is a foreign key referencing the column in the table.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.