January 2019
Intermediate to advanced
520 pages
14h 32m
English
The up script contains a statement that creates the channels table. Columns includes the channel id and user_id , which refers to the user in the users table. The channel also has a title column and an is_public column that contains a flag that represents the visibility of the channel. If is_public equals TRUE, it means the channel is public. Look at the following statement:
CREATE TABLE channels ( id SERIAL PRIMARY KEY, user_id INTEGER NOT NULL REFERENCES users, title TEXT NOT NULL, is_public BOOL NOT NULL, created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP);SELECT diesel_manage_updated_at('channels');
The table also has two columns—create_at, which takes the current timestamp ...
Read now
Unlock full access