-
-
Notifications
You must be signed in to change notification settings - Fork 53
Fix 949 #950
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
base: 3.x
Are you sure you want to change the base?
Fix 949 #950
Changes from all commits
d868e2f
f578810
3950cf5
82319f7
b185276
c872b59
f18fe8f
459fcba
0fe876a
09f71e8
6f20237
249e8dc
c2c1f57
f101f08
d55b334
bc19c25
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| # Change Log | ||
|
|
||
| ## [3.0.0] - 2025-03-30 | ||
| ## [3.0.0] - 2025-12-05 | ||
|
|
||
| ### Changed | ||
|
|
||
|
|
@@ -9,15 +9,20 @@ | |
|
|
||
| #### Breaking Changes | ||
|
|
||
| - Using `*increments()` for primary key definition now requires adding `.primay()` to the column definition. | ||
| - Changed raw expressions placeholder from requiringing explicit quoring per grammar (like this '?') to automaic (like this ?) | ||
| - Changed `update` and `delete` methods to return the affected rows instead of the model | ||
| - Seeding depencies are now in a separate`[seeder]` extension | ||
| - `Factory` class must now be imported from the sub-package `masoniteorm.factories` | ||
|
|
||
| ### Fixed | ||
|
|
||
| - Model `update` and `delete` not casting passed values | ||
| - QueryBuilder does not require `database.py` when passing connection detain in directly | ||
| - Import DB (ConnectionResolver) from config even if inline connection details are provided | ||
| - `*increments()` can be used fir non primary key columns if supported by the platform | ||
| - `*increments()` can be used fir non primary key columns if supported by the platform | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lines 22 y 23 are duplicated
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also, fir -> for? |
||
|
|
||
| - Model `update` and `delete` not casting passed values | ||
|
|
||
| ## [2.24.0] - 2025-01-23 | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,23 +6,21 @@ class CreateUsersTable(Migration): | |
|
|
||
| def up(self): | ||
| """Run the migrations.""" | ||
| with self.schema.create('users') as table: | ||
| table.increments('id') | ||
| table.string('name') | ||
| table.string('email').unique() | ||
| table.string('password') | ||
| table.string('second_password').nullable() | ||
| table.string('remember_token').nullable() | ||
| table.timestamp('verified_at').nullable() | ||
| with self.schema.create("users") as table: | ||
| table.increments("id").primary() | ||
| table.string("name") | ||
| table.string("email").unique() | ||
| table.string("password") | ||
| table.string("second_password").nullable() | ||
| table.string("remember_token").nullable() | ||
| table.timestamp("verified_at").nullable() | ||
| table.timestamps() | ||
|
|
||
| if not self.schema._dry: | ||
| User.on(self.connection).set_schema(self.schema_name).create({ | ||
| 'name': 'Joe', | ||
| 'email': '[email protected]', | ||
| 'password': 'secret' | ||
| }) | ||
| User.on(self.connection).set_schema(self.schema_name).create( | ||
| {"name": "Joe", "email": "[email protected]", "password": "secret"} | ||
| ) | ||
|
|
||
| def down(self): | ||
| """Revert the migrations.""" | ||
| self.schema.drop('users') | ||
| self.schema.drop("users") | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,20 @@ | ||
| from src.masoniteorm.migrations.Migration import Migration | ||
|
|
||
|
|
||
| class CreateFriendsTable(Migration): | ||
|
|
||
| def up(self): | ||
| def up(self): | ||
| """ | ||
| Run the migrations. | ||
| """ | ||
|
|
||
| with self.schema.create('friends') as table: | ||
| table.increments('id') | ||
| table.string('name') | ||
| table.integer('age') | ||
| with self.schema.create("friends") as table: | ||
| table.increments("id").primary() | ||
| table.string("name") | ||
| table.integer("age") | ||
|
|
||
| def down(self): | ||
| """ | ||
| Revert the migrations. | ||
| """ | ||
| self.schema.drop('friends') | ||
| self.schema.drop("friends") |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,19 @@ | ||
| from src.masoniteorm.migrations.Migration import Migration | ||
|
|
||
|
|
||
| class CreateArticlesTable(Migration): | ||
|
|
||
| def up(self): | ||
| def up(self): | ||
| """ | ||
| Run the migrations. | ||
| """ | ||
| with self.schema.create('fans') as table: | ||
| table.increments('id') | ||
| table.string('name') | ||
| table.integer('age') | ||
| with self.schema.create("fans") as table: | ||
| table.increments("id").primary() | ||
| table.string("name") | ||
| table.integer("age") | ||
|
|
||
| def down(self): | ||
| """ | ||
| Revert the migrations. | ||
| """ | ||
| self.schema.drop('fans') | ||
| self.schema.drop("fans") |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| from ..config import load_config | ||
| from ..connections import ConnectionResolver | ||
| from ..exceptions import ConnectionNotRegistered | ||
| from .Blueprint import Blueprint | ||
| from .Table import Table | ||
|
|
@@ -87,8 +88,14 @@ def on(self, connection_key): | |
| Returns: | ||
| cls | ||
| """ | ||
| resolver = load_config(config_path=self.config_path).DB | ||
| self.connection_details = resolver.get_connection_details() | ||
| if not self.connection_details: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be: If connection_details is not provided, load from config. If provided, use it directly. |
||
| resolver = ConnectionResolver( | ||
| connection_details=self.connection_details | ||
| ) | ||
| else: | ||
| resolver = load_config(config_path=self.config_path).DB | ||
| self.connection_details = resolver.get_connection_details() | ||
|
|
||
| if connection_key == "default": | ||
| self.connection = self.connection_details.get("default") | ||
| else: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be primary()