目前我正在使用庞大的rails应用程序和多个分支,每个分支都有一个新功能.它发生了很多功能需要迁移,在将它与master合并之前应该不会出现问题:schema.rb已经使用dev数据库的信息进行了更新!
澄清:
1. Branch A has migration create_table_x
2. Branch B has migration create_table_y
3. Branch A adds another create_table_z and runs db:migrate
4. You want to merge Branch A with Master and you see table_x, table_y and table_z in the schema.rb of Branch A.
Run Code Online (Sandbox Code Playgroud)
在分支中的每次迁移之前重置+种子数据库或为每个分支创建数据库都不是一个选项.由于2 GB SQL数据的巨大规模,它将无法使用.
我的问题:
是否真的需要将schema.rb保留在存储库中,因为每次迁移都会重建它?
如果是这样,是否可以从迁移而不是数据库转储构建架构?
我试图使用rhomobile框架让iphone的指南针工作.我已经完成了rhomobile部分,创建了一个在iphone上调用本机方法的工作包装器,但是我无法让事件发挥作用.
Locationmanager.h
#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>
@interface locationController : NSObject <CLLocationManagerDelegate>
{
CLLocationManager *locationManager;
}
@property (strong, nonatomic) CLLocationManager *locationManager;
- (id)init;
- (void)dealloc;
@end
Run Code Online (Sandbox Code Playgroud)
Locationmanager.m
#import "Locationmanager.h"
#include "ruby/ext/rho/rhoruby.h"
//store the values
double gx, gy, gz, gth;
//init location
locationController *lc;
@implementation locationController
@synthesize locationManager;
- (id)init {
if (self = [super init]) {
self.locationManager = [[CLLocationManager alloc] init];
NSLog(@"%@", [CLLocationManager headingAvailable]? @"\n\nHeading available!\n" : @"\n\nNo heading..\n");
NSLog(@"%@", [CLLocationManager locationServicesEnabled]? @"\n\nLocation available!\n" : @"\n\nNo location..\n");
// check if the …Run Code Online (Sandbox Code Playgroud)