Page Menu
Home
Musing Studio
Search
Configure Global Search
Log In
Files
F12725313
v8.go
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
v8.go
View Options
/*
* Copyright © 2020 A Bunch Tell LLC.
*
* This file is part of WriteFreely.
*
* WriteFreely is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, included
* in the LICENSE file in this source code package.
*/
package
migrations
import
(
"context"
"database/sql"
wf_db
"github.com/writeas/writefreely/db"
)
func
oauthInvites
(
db
*
datastore
)
error
{
dialect
:=
wf_db
.
DialectMySQL
if
db
.
driverName
==
driverSQLite
{
dialect
=
wf_db
.
DialectSQLite
}
return
wf_db
.
RunTransactionWithOptions
(
context
.
Background
(),
db
.
DB
,
&
sql
.
TxOptions
{},
func
(
ctx
context
.
Context
,
tx
*
sql
.
Tx
)
error
{
builders
:=
[]
wf_db
.
SQLBuilder
{
dialect
.
AlterTable
(
"oauth_client_states"
).
AddColumn
(
dialect
.
Column
(
"invite_code"
,
wf_db
.
ColumnTypeChar
,
wf_db
.
OptionalInt
{
Set
:
true
,
Value
:
6
,
}).
SetNullable
(
true
)),
}
for
_
,
builder
:=
range
builders
{
query
,
err
:=
builder
.
ToSQL
()
if
err
!=
nil
{
return
err
}
if
_
,
err
:=
tx
.
ExecContext
(
ctx
,
query
);
err
!=
nil
{
return
err
}
}
return
nil
})
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 20, 9:29 PM (1 d, 15 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3550503
Attached To
rWF WriteFreely
Event Timeline
Log In to Comment