premake 5 versions

This commit is contained in:
Aiden McClelland
2024-07-31 00:06:44 -06:00
parent 7cd3f285ad
commit 972ee8e42e
6 changed files with 196 additions and 1 deletions

View File

@@ -16,8 +16,13 @@ mod v0_3_5_2;
mod v0_3_6_alpha_0;
mod v0_3_6_alpha_1;
mod v0_3_6_alpha_2;
mod v0_3_6_alpha_3;
mod v0_3_6_alpha_4;
mod v0_3_6_alpha_5;
mod v0_3_6_alpha_6;
mod v0_3_6_alpha_7;
pub type Current = v0_3_6_alpha_2::Version;
pub type Current = v0_3_6_alpha_2::Version; // VERSION_BUMP
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone)]
#[serde(untagged)]
@@ -30,6 +35,11 @@ enum Version {
V0_3_6_alpha_0(Wrapper<v0_3_6_alpha_0::Version>),
V0_3_6_alpha_1(Wrapper<v0_3_6_alpha_1::Version>),
V0_3_6_alpha_2(Wrapper<v0_3_6_alpha_2::Version>),
V0_3_6_alpha_3(Wrapper<v0_3_6_alpha_3::Version>),
V0_3_6_alpha_4(Wrapper<v0_3_6_alpha_4::Version>),
V0_3_6_alpha_5(Wrapper<v0_3_6_alpha_5::Version>),
V0_3_6_alpha_6(Wrapper<v0_3_6_alpha_6::Version>),
V0_3_6_alpha_7(Wrapper<v0_3_6_alpha_7::Version>),
Other(exver::Version),
}
@@ -52,6 +62,11 @@ impl Version {
Version::V0_3_6_alpha_0(Wrapper(x)) => x.semver(),
Version::V0_3_6_alpha_1(Wrapper(x)) => x.semver(),
Version::V0_3_6_alpha_2(Wrapper(x)) => x.semver(),
Version::V0_3_6_alpha_3(Wrapper(x)) => x.semver(),
Version::V0_3_6_alpha_4(Wrapper(x)) => x.semver(),
Version::V0_3_6_alpha_5(Wrapper(x)) => x.semver(),
Version::V0_3_6_alpha_6(Wrapper(x)) => x.semver(),
Version::V0_3_6_alpha_7(Wrapper(x)) => x.semver(),
Version::Other(x) => x.clone(),
}
}
@@ -254,6 +269,11 @@ pub async fn init(
Version::V0_3_6_alpha_0(v) => v.0.migrate_to(&Current::new(), &db, &mut progress).await?,
Version::V0_3_6_alpha_1(v) => v.0.migrate_to(&Current::new(), &db, &mut progress).await?,
Version::V0_3_6_alpha_2(v) => v.0.migrate_to(&Current::new(), &db, &mut progress).await?,
Version::V0_3_6_alpha_3(v) => v.0.migrate_to(&Current::new(), &db, &mut progress).await?,
Version::V0_3_6_alpha_4(v) => v.0.migrate_to(&Current::new(), &db, &mut progress).await?,
Version::V0_3_6_alpha_5(v) => v.0.migrate_to(&Current::new(), &db, &mut progress).await?,
Version::V0_3_6_alpha_6(v) => v.0.migrate_to(&Current::new(), &db, &mut progress).await?,
Version::V0_3_6_alpha_7(v) => v.0.migrate_to(&Current::new(), &db, &mut progress).await?,
Version::Other(_) => {
return Err(Error::new(
eyre!("Cannot downgrade"),

View File

@@ -0,0 +1,35 @@
use exver::{PreReleaseSegment, VersionRange};
use super::v0_3_5::V0_3_0_COMPAT;
use super::{v0_3_6_alpha_2, VersionT};
use crate::db::model::Database;
use crate::prelude::*;
lazy_static::lazy_static! {
static ref V0_3_6_alpha_3: exver::Version = exver::Version::new(
[0, 3, 6],
[PreReleaseSegment::String("alpha".into()), 3.into()]
);
}
#[derive(Clone, Debug)]
pub struct Version;
impl VersionT for Version {
type Previous = v0_3_6_alpha_2::Version;
fn new() -> Self {
Version
}
fn semver(&self) -> exver::Version {
V0_3_6_alpha_3.clone()
}
fn compat(&self) -> &'static VersionRange {
&V0_3_0_COMPAT
}
async fn up(&self, _db: &TypedPatchDb<Database>) -> Result<(), Error> {
Ok(())
}
async fn down(&self, _db: &TypedPatchDb<Database>) -> Result<(), Error> {
Ok(())
}
}

View File

@@ -0,0 +1,35 @@
use exver::{PreReleaseSegment, VersionRange};
use super::v0_3_5::V0_3_0_COMPAT;
use super::{v0_3_6_alpha_3, VersionT};
use crate::db::model::Database;
use crate::prelude::*;
lazy_static::lazy_static! {
static ref V0_3_6_alpha_4: exver::Version = exver::Version::new(
[0, 3, 6],
[PreReleaseSegment::String("alpha".into()), 4.into()]
);
}
#[derive(Clone, Debug)]
pub struct Version;
impl VersionT for Version {
type Previous = v0_3_6_alpha_3::Version;
fn new() -> Self {
Version
}
fn semver(&self) -> exver::Version {
V0_3_6_alpha_4.clone()
}
fn compat(&self) -> &'static VersionRange {
&V0_3_0_COMPAT
}
async fn up(&self, _db: &TypedPatchDb<Database>) -> Result<(), Error> {
Ok(())
}
async fn down(&self, _db: &TypedPatchDb<Database>) -> Result<(), Error> {
Ok(())
}
}

View File

@@ -0,0 +1,35 @@
use exver::{PreReleaseSegment, VersionRange};
use super::v0_3_5::V0_3_0_COMPAT;
use super::{v0_3_6_alpha_4, VersionT};
use crate::db::model::Database;
use crate::prelude::*;
lazy_static::lazy_static! {
static ref V0_3_6_alpha_5: exver::Version = exver::Version::new(
[0, 3, 6],
[PreReleaseSegment::String("alpha".into()), 5.into()]
);
}
#[derive(Clone, Debug)]
pub struct Version;
impl VersionT for Version {
type Previous = v0_3_6_alpha_4::Version;
fn new() -> Self {
Version
}
fn semver(&self) -> exver::Version {
V0_3_6_alpha_5.clone()
}
fn compat(&self) -> &'static VersionRange {
&V0_3_0_COMPAT
}
async fn up(&self, _db: &TypedPatchDb<Database>) -> Result<(), Error> {
Ok(())
}
async fn down(&self, _db: &TypedPatchDb<Database>) -> Result<(), Error> {
Ok(())
}
}

View File

@@ -0,0 +1,35 @@
use exver::{PreReleaseSegment, VersionRange};
use super::v0_3_5::V0_3_0_COMPAT;
use super::{v0_3_6_alpha_5, VersionT};
use crate::db::model::Database;
use crate::prelude::*;
lazy_static::lazy_static! {
static ref V0_3_6_alpha_6: exver::Version = exver::Version::new(
[0, 3, 6],
[PreReleaseSegment::String("alpha".into()), 6.into()]
);
}
#[derive(Clone, Debug)]
pub struct Version;
impl VersionT for Version {
type Previous = v0_3_6_alpha_5::Version;
fn new() -> Self {
Version
}
fn semver(&self) -> exver::Version {
V0_3_6_alpha_6.clone()
}
fn compat(&self) -> &'static VersionRange {
&V0_3_0_COMPAT
}
async fn up(&self, _db: &TypedPatchDb<Database>) -> Result<(), Error> {
Ok(())
}
async fn down(&self, _db: &TypedPatchDb<Database>) -> Result<(), Error> {
Ok(())
}
}

View File

@@ -0,0 +1,35 @@
use exver::{PreReleaseSegment, VersionRange};
use super::v0_3_5::V0_3_0_COMPAT;
use super::{v0_3_6_alpha_6, VersionT};
use crate::db::model::Database;
use crate::prelude::*;
lazy_static::lazy_static! {
static ref V0_3_6_alpha_7: exver::Version = exver::Version::new(
[0, 3, 6],
[PreReleaseSegment::String("alpha".into()), 7.into()]
);
}
#[derive(Clone, Debug)]
pub struct Version;
impl VersionT for Version {
type Previous = v0_3_6_alpha_6::Version;
fn new() -> Self {
Version
}
fn semver(&self) -> exver::Version {
V0_3_6_alpha_7.clone()
}
fn compat(&self) -> &'static VersionRange {
&V0_3_0_COMPAT
}
async fn up(&self, _db: &TypedPatchDb<Database>) -> Result<(), Error> {
Ok(())
}
async fn down(&self, _db: &TypedPatchDb<Database>) -> Result<(), Error> {
Ok(())
}
}