Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions refinery_core/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ fn file_stem_re() -> &'static Regex {
/// Matches the stem + extension of a SQL migration file.
fn file_re_sql() -> &'static Regex {
static RE: OnceLock<Regex> = OnceLock::new();
RE.get_or_init(|| Regex::new([STEM_RE, r"\.sql$"].concat().as_str()).unwrap())
RE.get_or_init(|| Regex::new([STEM_RE, r"\.(sql|surql)$"].concat().as_str()).unwrap())
}

/// Matches the stem + extension of any migration file.
fn file_re_all() -> &'static Regex {
static RE: OnceLock<Regex> = OnceLock::new();
RE.get_or_init(|| Regex::new([STEM_RE, r"\.(rs|sql)$"].concat().as_str()).unwrap())
RE.get_or_init(|| Regex::new([STEM_RE, r"\.(rs|sql|surql)$"].concat().as_str()).unwrap())
}

/// enum containing the migration types used to search for migrations
Expand Down
2 changes: 1 addition & 1 deletion refinery_macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ pub fn embed_migrations(input: TokenStream) -> TokenStream {
let extension = migration.extension().unwrap();
migration_filenames.push(filename.clone());

if extension == "sql" {
if extension == "sql" || extension == "surql" {
_migrations.push(quote! {(#filename, include_str!(#path).to_string())});
} else if extension == "rs" {
let rs_content = fs::read_to_string(&path)
Expand Down
Loading