Skip to content


Add db install script #158

Krinkle opened this Issue · 0 comments

1 participant

jQuery Foundation member

As alternative for tables.sql / reset.sql. An easy way to (re)install TestSwarm. Could also be used as a bold way to update without keeping data.

See also:

  • #142 Add db upgrade script
  • #74 Automate installation
@Krinkle Krinkle was assigned
@Krinkle Krinkle added a commit that referenced this issue
@Krinkle Krinkle Create db update (issue #142) and db install script (issue #158)
- Implement method MaintenanceScript::cliInput
  Get an answer from the user from STDIN on the cli.
  This requires that the script be executed directly from shell as
  the primary command. If it detects a piped input, or writing output
  to a file, it will abort the script as soon as cliInput it used.

- Automatically output a line break if out() is used.
  In almost all cases this is the intention, cleaned up scripts
  that were making lots of calls like out(.. "\n").
  Added an outRaw() that circumvents this. In a few places in the
  upgrade script, output goes like "Foo..." and then "OK/FAILED"
  is appended to that line later on.

- Force a line break before a fatal script error() call output

- Moved SignupAction logic into a doCreateUser method so that it
  can be easily used by the upgrade script without having to either:
 * Duplicate seed/hashing logic
 * Create a fake request context, and then somehow undo the session
   manipulation (since SignupAction auto-logins)

- For now the update script only has '1.0.0-alpha' in it.
  It starts with 1 or 2 questions that can be skipped with --quick.
  These questions don't affect the actual update progress but safe
  overhead in the obvious case where there shouldn't be any updates.

- Actual updater method doesn't use versioning to update but looks
  at the actual database schema and executes updates based on what
  it should be and what it currently is. As a start it only contains
  updates for 0.2.0 -> 1.0.0-alpha. It is not a real updater as there
  are too many breaking changes in 1.0.0. Instead it asks the user
  for an additional confirmation to delete all data (except for user
  credentials and auth token), re-installs from testswarm.sql and
  then does several Signup actions and restores the seed/token

- Also implemented a simple database (re)install script that
  optionally wipes all data (as alternative for the old reset.sql)

  Easy for users that can't or don't want to use mysql tools.

  Can also be used as a bold way to upgrade to a new version if you
  don't care about old data.
@Krinkle Krinkle closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.