clean up team_memberships schema

This commit is contained in:
Brent Schroeter 2025-03-08 21:52:30 -08:00
parent 37e91c36a8
commit 4a62d66400
4 changed files with 1 additions and 5 deletions

View file

@ -18,7 +18,6 @@ CREATE TABLE teams (
);
CREATE TABLE team_memberships (
roles TEXT[] NOT NULL DEFAULT '{}',
team_id UUID NOT NULL REFERENCES teams(id) ON DELETE CASCADE,
user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
PRIMARY KEY (team_id, user_id)
@ -47,7 +46,7 @@ CREATE TABLE IF NOT EXISTS channels (
team_id UUID NOT NULL REFERENCES teams(id) ON DELETE CASCADE,
name TEXT NOT NULL,
enable_by_default BOOLEAN NOT NULL DEFAULT FALSE,
backend_config JSONB NOT NULL DEFAULT '{}'::JSONB
backend_config JSONB NOT NULL
);
CREATE TABLE IF NOT EXISTS channel_selections (

View file

@ -214,7 +214,6 @@ async fn post_new_team(
let team_membership = TeamMembership {
team_id: team_id.clone(),
user_id: current_user.id,
roles: vec![Some("OWNER".to_string())],
};
db_conn
.interact(move |conn| {

View file

@ -65,7 +65,6 @@ diesel::table! {
team_memberships (team_id, user_id) {
team_id -> Uuid,
user_id -> Uuid,
roles -> Array<Nullable<Text>>,
}
}

View file

@ -20,7 +20,6 @@ use crate::{
pub struct TeamMembership {
pub team_id: Uuid,
pub user_id: Uuid,
pub roles: Vec<Option<String>>,
}
impl TeamMembership {