Skip to content

Commit dfd89f1

Browse files
committed
Create a table for crate invitations
1 parent c9c1477 commit dfd89f1

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DROP TABLE crate_owner_invitations;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CREATE TABLE crate_owner_invitations (
2+
invited_user_id INTEGER NOT NULL REFERENCES users (id) ON DELETE CASCADE,
3+
invited_by_user_id INTEGER NOT NULL REFERENCES users (id) ON DELETE CASCADE,
4+
crate_id INTEGER NOT NULL REFERENCES crates (id) ON DELETE CASCADE,
5+
created_at TIMESTAMP NOT NULL DEFAULT now(),
6+
PRIMARY KEY (invited_user_id, crate_id)
7+
);

src/schema.rs

+33
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,38 @@ table! {
138138
}
139139
}
140140

141+
table! {
142+
/// Representation of the `crate_owner_invitations` table.
143+
///
144+
/// (Automatically generated by Diesel.)
145+
crate_owner_invitations (invited_user_id, crate_id) {
146+
/// The `invited_user_id` column of the `crate_owner_invitations` table.
147+
///
148+
/// Its SQL type is `Int4`.
149+
///
150+
/// (Automatically generated by Diesel.)
151+
invited_user_id -> Int4,
152+
/// The `invited_by_user_id` column of the `crate_owner_invitations` table.
153+
///
154+
/// Its SQL type is `Int4`.
155+
///
156+
/// (Automatically generated by Diesel.)
157+
invited_by_user_id -> Int4,
158+
/// The `crate_id` column of the `crate_owner_invitations` table.
159+
///
160+
/// Its SQL type is `Int4`.
161+
///
162+
/// (Automatically generated by Diesel.)
163+
crate_id -> Int4,
164+
/// The `created_at` column of the `crate_owner_invitations` table.
165+
///
166+
/// Its SQL type is `Timestamp`.
167+
///
168+
/// (Automatically generated by Diesel.)
169+
created_at -> Timestamp,
170+
}
171+
}
172+
141173
table! {
142174
/// Representation of the `crate_owners` table.
143175
///
@@ -720,3 +752,4 @@ joinable!(version_downloads -> versions (version_id));
720752
joinable!(crate_owners -> teams (owner_id));
721753
joinable!(crate_owners -> users (owner_id));
722754
joinable!(readme_rendering -> versions (version_id));
755+
joinable!(crate_owner_invitations -> crates (crate_id));

0 commit comments

Comments
 (0)