generated from admin/template
выполнена лабораторная работа 1
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
Table follows {
|
||||
following_user_id integer [not null]
|
||||
followed_user_id integer [not null]
|
||||
created_at timestamp
|
||||
}
|
||||
|
||||
Table users {
|
||||
id integer [primary key]
|
||||
username varchar
|
||||
role varchar
|
||||
created_at timestamp
|
||||
}
|
||||
|
||||
Table posts {
|
||||
id integer [primary key]
|
||||
title varchar
|
||||
body text [note: 'Content of the post']
|
||||
user_id integer [not null]
|
||||
status varchar
|
||||
created_at timestamp
|
||||
}
|
||||
|
||||
Ref user_posts: posts.user_id ?> users.id // many-to-one
|
||||
|
||||
Ref: users.id <? follows.following_user_id
|
||||
|
||||
Ref: users.id <? follows.followed_user_id
|
||||
|
||||
Records users(id, username, role) {
|
||||
0, 'Alice', 'admin'
|
||||
1, 'Bob', 'moderator'
|
||||
2, 'Candice', 'moderator'
|
||||
3, 'David', 'member'
|
||||
}
|
||||
|
||||
Records follows(following_user_id, followed_user_id, created_at) {
|
||||
1, 0, '2026-01-01'
|
||||
3, 2, '2026-02-28'
|
||||
}
|
||||
|
||||
Records posts(id, title, user_id) {
|
||||
0, 'Welcome to the forum!', 0
|
||||
1, 'Guidelines', 1
|
||||
2, 'Hello all!', 3
|
||||
}
|
||||
Reference in New Issue
Block a user