cleaned up db schema
This commit is contained in:
parent
4c7f72570e
commit
ad191a5393
3 changed files with 11 additions and 47 deletions
|
@ -31,24 +31,6 @@ CREATE TABLE IF NOT EXISTS diec (
|
|||
data JSONB
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS msoffice_oleid (
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
file_id UUID REFERENCES files (id) ON DELETE CASCADE,
|
||||
data JSONB
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS msoffice_olevba (
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
file_id UUID REFERENCES files (id) ON DELETE CASCADE,
|
||||
data JSONB
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS msoffice_mraptor (
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
file_id UUID REFERENCES files (id) ON DELETE CASCADE,
|
||||
data JSONB
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS msoffice (
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
file_id UUID REFERENCES files (id) ON DELETE CASCADE,
|
||||
|
|
|
@ -53,24 +53,6 @@ type Msoffice struct {
|
|||
Macros [][]string
|
||||
}
|
||||
|
||||
type MsofficeMraptor struct {
|
||||
ID int64
|
||||
FileID pgtype.UUID
|
||||
Data []byte
|
||||
}
|
||||
|
||||
type MsofficeOleid struct {
|
||||
ID int64
|
||||
FileID pgtype.UUID
|
||||
Data []byte
|
||||
}
|
||||
|
||||
type MsofficeOlevba struct {
|
||||
ID int64
|
||||
FileID pgtype.UUID
|
||||
Data []byte
|
||||
}
|
||||
|
||||
type ProcessingJob struct {
|
||||
ID int64
|
||||
FileID pgtype.UUID
|
||||
|
|
|
@ -26,8 +26,8 @@ type GetMSOfficeDataRow struct {
|
|||
Mraptor []byte
|
||||
}
|
||||
|
||||
func (q *Queries) GetMSOfficeData(ctx context.Context, fileID pgtype.UUID) (GetMSOfficeDataRow, error) {
|
||||
row := q.db.QueryRow(ctx, getMSOfficeData, fileID)
|
||||
func (q *Queries) GetMSOfficeData(ctx context.Context, dollar_1 pgtype.UUID) (GetMSOfficeDataRow, error) {
|
||||
row := q.db.QueryRow(ctx, getMSOfficeData, dollar_1)
|
||||
var i GetMSOfficeDataRow
|
||||
err := row.Scan(
|
||||
&i.FileID,
|
||||
|
@ -74,12 +74,12 @@ INSERT INTO msoffice_mraptor (
|
|||
`
|
||||
|
||||
type InsertFileMsofficeMraptorParams struct {
|
||||
FileID pgtype.UUID
|
||||
Data []byte
|
||||
Column1 pgtype.UUID
|
||||
Column2 []byte
|
||||
}
|
||||
|
||||
func (q *Queries) InsertFileMsofficeMraptor(ctx context.Context, arg InsertFileMsofficeMraptorParams) error {
|
||||
_, err := q.db.Exec(ctx, insertFileMsofficeMraptor, arg.FileID, arg.Data)
|
||||
_, err := q.db.Exec(ctx, insertFileMsofficeMraptor, arg.Column1, arg.Column2)
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -90,12 +90,12 @@ INSERT INTO msoffice_oleid (
|
|||
`
|
||||
|
||||
type InsertFileMsofficeOleidParams struct {
|
||||
FileID pgtype.UUID
|
||||
Data []byte
|
||||
Column1 pgtype.UUID
|
||||
Column2 []byte
|
||||
}
|
||||
|
||||
func (q *Queries) InsertFileMsofficeOleid(ctx context.Context, arg InsertFileMsofficeOleidParams) error {
|
||||
_, err := q.db.Exec(ctx, insertFileMsofficeOleid, arg.FileID, arg.Data)
|
||||
_, err := q.db.Exec(ctx, insertFileMsofficeOleid, arg.Column1, arg.Column2)
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -106,12 +106,12 @@ INSERT INTO msoffice_olevba (
|
|||
`
|
||||
|
||||
type InsertFileMsofficeOlevbaParams struct {
|
||||
FileID pgtype.UUID
|
||||
Data []byte
|
||||
Column1 pgtype.UUID
|
||||
Column2 []byte
|
||||
}
|
||||
|
||||
func (q *Queries) InsertFileMsofficeOlevba(ctx context.Context, arg InsertFileMsofficeOlevbaParams) error {
|
||||
_, err := q.db.Exec(ctx, insertFileMsofficeOlevba, arg.FileID, arg.Data)
|
||||
_, err := q.db.Exec(ctx, insertFileMsofficeOlevba, arg.Column1, arg.Column2)
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue