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

Migration/Setup Facilities #89

Closed
MichaelXavier opened this issue Feb 11, 2012 · 1 comment
Closed

Migration/Setup Facilities #89

MichaelXavier opened this issue Feb 11, 2012 · 1 comment
Labels
🏷️ feat This PR introduces a new feature

Comments

@MichaelXavier
Copy link

I'm looking into writing an adapter for IndexedDB. One of the technical hurdles is that IndexedDb has a setup process wherein the local database is mirated and indexed. I wanted to know if you guys had any opinions or ideas on how data-core could accommodate database configuration and migration. I figure migration would need to receive the complete set of models so it could query their structures, create the appropriate indices, etc.

@wycats
Copy link
Member

wycats commented Feb 26, 2012

At the moment, I don't think this is a good fit for core. However, we have recently added a number of introspection facilities to models that should make a migration facility possible.

Most importantly:

var attributes = Ember.get(Person, 'attributes');

attributes.forEach(function(name, metadata) {
  // metadata contains `type` and `key`
  // it will probably contain more in the future
});


var associations = Ember.get(Person, 'associations');

associations.forEach(function(type, list) {
  list.forEach(function(metadata) {
    // metadata contains `name` and `kind`
  });
});

We'd be happy to host a migration solution in the ember organization, and I'd be happy to help you with any further APIs you need or to review the code.

Please email me at wycats@gmail.com if you have something to look at (or if you have general questions about migrations) and open a new ticket if you need some other API from Ember.

@wycats wycats closed this as completed Feb 26, 2012
@runspired runspired added 🏷️ feat This PR introduces a new feature and removed Improvement labels Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ feat This PR introduces a new feature
Projects
None yet
Development

No branches or pull requests

3 participants