Add makeid column to Goggles DB

RESOLVED FIXED

Status

Webmaker
X-Ray Goggles
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: jbuck, Assigned: jbuck)

Tracking

Details

(Assignee)

Description

5 years ago
Need to run the following script on staging and prod:

Jons-MacBook-Pro:goggles.webmaker.org jon$ cat migrations/09202013-add-makeid-column.sql
# Add the makeid column to the butter database
ALTER TABLE ThimbleProjects ADD COLUMN makeid CHAR(40);
ALTER TABLE ThimbleProjects ADD UNIQUE KEY(makeid);

Once it's been added, and the appropriate version of
(Assignee)

Comment 1

5 years ago
Bah!

Once it's been added, and the appropriate version of goggles is on staging/prod, we can run the migration script:

node migrations/ThimbleProjectMakeIDMigration.js
(Assignee)

Updated

5 years ago
Blocks: 918952
No longer depends on: 918952
(Assignee)

Comment 2

5 years ago
:jp, can you apply that SQL script to googles-staging? I don't have the RDS credentials on LastPass (please share?)

Once we've changed the DB on staging, we can push the new version of Goggles to staging and test there.
Flags: needinfo?(johns)

Comment 3

5 years ago
Run in staging!
use goggles;
ALTER TABLE ThimbleProjects ADD COLUMN makeid CHAR(40); (took: 1.114seconds)
ALTER TABLE ThimbleProjects ADD UNIQUE KEY(makeid); (took 0.613 seconds)
Flags: needinfo?(johns)
(Assignee)

Comment 4

5 years ago
Ran into a bug while running the makeid migration script:

ubuntu@i-cfce06b6:/var/www/goggles$ node migrations/ThimbleProjectMakeIDMigration.js

module.js:340
    throw err;
          ^
Error: Cannot find module '/var/www/goggles/lib/models/ThimbleProject'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at module.exports.Sequelize.import (/var/www/goggles/node_modules/sequelize/lib/sequelize.js:161:24)
    at databaseHandleConstructor (/var/www/goggles/lib/database.js:43:31)
    at Object.<anonymous> (/var/www/goggles/migrations/ThimbleProjectMakeIDMigration.js:18:13)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
ubuntu@i-cfce06b6:/var/www/goggles$ ls lib/models/
legacyproject.js  thimbleproject.js
(Assignee)

Comment 5

5 years ago
Matt fixed this in https://github.com/mozilla/goggles.webmaker.org/commit/f80afa67ae60afa125c5f2cca5f1f1fefc6ff182 by changing `ThimbleProject` to `thimbleproject`
(Assignee)

Comment 6

5 years ago
Added makeid column to goggles-prod db:

CREATE TABLE `ThimbleProjects` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `userid` varchar(255) DEFAULT NULL,
  `url` varchar(255) DEFAULT NULL,
  `remixedFrom` varchar(255) DEFAULT NULL,
  `rawData` text,
  `sanitizedData` text,
  `title` varchar(255) DEFAULT NULL,
  `createdAt` datetime NOT NULL,
  `updatedAt` datetime NOT NULL,
  `makeid` char(40) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `makeid` (`makeid`)
) ENGINE=InnoDB AUTO_INCREMENT=668 DEFAULT CHARSET=utf8;
(Assignee)

Comment 7

5 years ago
Pushing v0.0.21 to prod now: https://jenkins.mofoprod.net/job/PRODPUSH-goggles/10/console
(Assignee)

Comment 8

5 years ago
Ran makeid migration script:

ubuntu@i-51021a39:/var/www/goggles$ node migrations/ThimbleProjectMakeIDMigration.js
Hooray! All of the goggles makes have been updated

And we're good to go:

http://jon.makes.org/goggles/jons-remix-of-xray-goggles-2
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.