Add Native Sharing REST API (#1150)

* Initial draft - UNTESTED

* changes to Save() and Update()

* apply col filter and limit nanoid

* remove columns to not update
This commit is contained in:
Yash Jipkate
2021-06-09 01:14:30 +05:30
committed by GitHub
parent e80cf80d05
commit af210c8903
9 changed files with 112 additions and 6 deletions
@@ -0,0 +1,25 @@
package migrations
import (
"database/sql"
"github.com/pressly/goose"
)
func init() {
goose.AddMigration(upUpdateShareFieldNames, downUpdateShareFieldNames)
}
func upUpdateShareFieldNames(tx *sql.Tx) error {
_, err := tx.Exec(`
alter table share rename column expires to expires_at;
alter table share rename column created to created_at;
alter table share rename column last_visited to last_visited_at;
`)
return err
}
func downUpdateShareFieldNames(tx *sql.Tx) error {
return nil
}