A clean, Markdown-based publishing platform made for writers. Write together, and build a community. https://writefreely.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

36 lines
792 B

  1. /*
  2. * Copyright © 2019 A Bunch Tell LLC.
  3. *
  4. * This file is part of WriteFreely.
  5. *
  6. * WriteFreely is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU Affero General Public License, included
  8. * in the LICENSE file in this source code package.
  9. */
  10. package migrations
  11. func supportInstancePages(db *datastore) error {
  12. t, err := db.Begin()
  13. _, err = t.Exec(`ALTER TABLE appcontent ADD COLUMN title ` + db.typeVarChar(255) + db.collateMultiByte() + ` NULL`)
  14. if err != nil {
  15. t.Rollback()
  16. return err
  17. }
  18. _, err = t.Exec(`ALTER TABLE appcontent ADD COLUMN content_type ` + db.typeVarChar(36) + ` DEFAULT 'page' NOT NULL`)
  19. if err != nil {
  20. t.Rollback()
  21. return err
  22. }
  23. err = t.Commit()
  24. if err != nil {
  25. t.Rollback()
  26. return err
  27. }
  28. return nil
  29. }