drom fk
This commit is contained in:
parent
0529ec6ca0
commit
37acc4b079
@ -1 +1 @@
|
||||
ALTER TABLE question DROP CONSTRAINT IF EXISTS fk_auditory, DROP COLUMN IF EXISTS auditory;
|
||||
ALTER TABLE question DROP COLUMN IF EXISTS auditory;
|
@ -1,2 +1 @@
|
||||
ALTER TABLE question ADD COLUMN auditory BIGINT,
|
||||
ADD CONSTRAINT fk_auditory FOREIGN KEY (auditory) REFERENCES gigachatAudience(ID);
|
||||
ALTER TABLE question ADD COLUMN auditory BIGINT DEFAULT 0;
|
||||
|
@ -44,6 +44,7 @@ func (r *QuestionRepository) CreateQuestion(ctx context.Context, record *model.Q
|
||||
ParentIds: record.ParentIds,
|
||||
UpdatedAt: sql.NullTime{Time: time.Now(), Valid: true},
|
||||
Session: record.Session,
|
||||
Auditory: record.Auditory,
|
||||
}
|
||||
|
||||
data, err := r.queries.InsertQuestion(ctx, params)
|
||||
@ -110,7 +111,7 @@ func (r *QuestionRepository) GetQuestionList(
|
||||
whereClause = append(whereClause, fmt.Sprintf("to_tsvector('russian', que.title) @@ to_tsquery('russian', $%d)", len(data)))
|
||||
}
|
||||
|
||||
whereClause = append(whereClause, "que.auditory IS NULL")
|
||||
whereClause = append(whereClause, "que.auditory = 0")
|
||||
|
||||
data = append(data, limit, offset)
|
||||
if len(whereClause) != 0 {
|
||||
|
Loading…
Reference in New Issue
Block a user