swaf/dist/db/Migration.js

20 lines
1.9 KiB
JavaScript
Raw Normal View History

2020-04-22 15:52:17 +02:00
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
export default class Migration {
constructor(version) {
this.version = version;
}
shouldRun(currentVersion) {
return __awaiter(this, void 0, void 0, function* () {
return this.version > currentVersion;
});
}
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWlncmF0aW9uLmpzIiwic291cmNlUm9vdCI6Ii4vIiwic291cmNlcyI6WyJkYi9NaWdyYXRpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBQUEsTUFBTSxDQUFDLE9BQU8sT0FBZ0IsU0FBUztJQUduQyxZQUFZLE9BQWU7UUFDdkIsSUFBSSxDQUFDLE9BQU8sR0FBRyxPQUFPLENBQUM7SUFDM0IsQ0FBQztJQUVLLFNBQVMsQ0FBQyxjQUFzQjs7WUFDbEMsT0FBTyxJQUFJLENBQUMsT0FBTyxHQUFHLGNBQWMsQ0FBQztRQUN6QyxDQUFDO0tBQUE7Q0FLSiIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBkZWZhdWx0IGFic3RyYWN0IGNsYXNzIE1pZ3JhdGlvbiB7XG4gICAgcHVibGljIHJlYWRvbmx5IHZlcnNpb246IG51bWJlcjtcblxuICAgIGNvbnN0cnVjdG9yKHZlcnNpb246IG51bWJlcikge1xuICAgICAgICB0aGlzLnZlcnNpb24gPSB2ZXJzaW9uO1xuICAgIH1cblxuICAgIGFzeW5jIHNob3VsZFJ1bihjdXJyZW50VmVyc2lvbjogbnVtYmVyKTogUHJvbWlzZTxib29sZWFuPiB7XG4gICAgICAgIHJldHVybiB0aGlzLnZlcnNpb24gPiBjdXJyZW50VmVyc2lvbjtcbiAgICB9XG5cbiAgICBhYnN0cmFjdCBhc3luYyBpbnN0YWxsKCk6IFByb21pc2U8dm9pZD47XG5cbiAgICBhYnN0cmFjdCBhc3luYyByb2xsYmFjaygpOiBQcm9taXNlPHZvaWQ+O1xufSJdfQ==