-
-
Save gotomypc/3968030 to your computer and use it in GitHub Desktop.
An example of a data migration in NoSQLite
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "nosqlite" | |
require "Math.uuid" | |
convert_callback: (row) -> | |
if not row.guid? | |
row.guid: Math.uuidFast(); | |
return row; | |
db_file: "my_db.sqlite" | |
db: nosqlite.connect db_file, -> | |
db.migrate_table "log_source", convert_callback, (err, res) -> | |
debug err | |
debug res | |
db.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment