Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Visualization Backups table #5776

Merged
merged 1 commit into from
Sep 28, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions db/migrate/20150928100216_create_visualization_backups.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Sequel.migration do
up do
Rails::Sequel::connection.run 'CREATE EXTENSION IF NOT EXISTS "uuid-ossp"'

# INFO: On purpose without indexes, constraints, etc.
create_table :visualization_backups do
String :username, null: false
Uuid :visualization, null: false
String :export_vizjson, null: false
DateTime :created_at, default: Sequel::CURRENT_TIMESTAMP
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • It would be nice having a :source field with the cause of the backup (ghost tables, manual deletion, whatever).
  • We should push type safety and make :export_vizjson json type. I've had some discussions about this for cdb_conf and we finally pushed for json type as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The source/type of backup will come but inside the export_vizjson, as it already requires some extra things like versioning, always exporting all layers, an owner... So taken care inside there.
  • The idea is to have a quickly working solution without much logic at this level, that's why also there are no constraints at other fields, so I'd rather build something really simple and if later given time to, improve the data type.

But thanks for the suggestion, if we iterate over this I'll surely change the type, is just that the biggest requisite is "have it fast" so making tradeoffs wherever I can to achieve it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

end
end

down do
drop_table :visualization_backups
end
end