Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 46 for migrated (0.17 sec)

  1. tests/migrate_test.go

    		ID        uint
    		Name      string
    		ManagerID *uint
    		Manager   *MigratePerson
    	}
    
    	DB.Migrator().DropTable(&MigratePerson{})
    
    	if err := DB.AutoMigrate(&MigratePerson{}); err != nil {
    		t.Fatalf("Failed to auto migrate, but got error %v", err)
    	}
    
    	if !DB.Migrator().HasConstraint("migrate_people", "fk_migrate_people_manager") {
    		t.Fatalf("Failed to find has one constraint between people and managers")
    	}
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  2. cmd/format-erasure.go

    	if err := json.Unmarshal(b, format); err != nil {
    		return "", err
    	}
    	return format.Erasure.Version, nil
    }
    
    // Migrates all previous versions to latest version of `format.json`,
    // this code calls migration in sequence, such as V1 is migrated to V2
    // first before it V2 migrates to V3.n
    func formatErasureMigrate(export string) ([]byte, fs.FileInfo, error) {
    	formatPath := pathJoin(export, minioMetaBucket, formatConfigFile)
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri May 03 15:54:03 GMT 2024
    - 23.2K bytes
    - Viewed (0)
  3. migrator/migrator.go

    		).Error
    	})
    }
    
    // MigrateColumn migrate column
    func (m Migrator) MigrateColumn(value interface{}, field *schema.Field, columnType gorm.ColumnType) error {
    	if field.IgnoreMigration {
    		return nil
    	}
    
    	// found, smart migrate
    	fullDataType := strings.TrimSpace(strings.ToLower(m.DB.Migrator().FullDataTypeOf(field).SQL))
    	realDataType := strings.ToLower(columnType.DatabaseTypeName())
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  4. migrator.go

    package gorm
    
    import (
    	"reflect"
    
    	"gorm.io/gorm/clause"
    	"gorm.io/gorm/schema"
    )
    
    // Migrator returns migrator
    func (db *DB) Migrator() Migrator {
    	tx := db.getInstance()
    
    	// apply scopes to migrator
    	for len(tx.Statement.scopes) > 0 {
    		tx = tx.executeScopes()
    	}
    
    	return tx.Dialector.Migrator(tx.Session(&Session{}))
    }
    
    // AutoMigrate run auto migration for given models
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  5. tests/postgres_test.go

    	}
    
    	if err := DB.Exec("CREATE EXTENSION IF NOT EXISTS pgcrypto;").Error; err != nil {
    		t.Errorf("Failed to create extension pgcrypto, got error %v", err)
    	}
    
    	DB.Migrator().DropTable(&Yasuo{})
    
    	if err := DB.AutoMigrate(&Yasuo{}); err != nil {
    		t.Fatalf("Failed to migrate for uuid default value, got error: %v", err)
    	}
    
    	yasuo := Yasuo{Name: "jinzhu"}
    	if err := DB.Create(&yasuo).Error; err != nil {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Oct 08 09:16:32 GMT 2022
    - 6.4K bytes
    - Viewed (3)
  6. tests/embedded_struct_test.go

    		ImageUrl string
    	}
    
    	DB.Migrator().DropTable(&HNPost{}, &EngadgetPost{})
    	if err := DB.Migrator().AutoMigrate(&HNPost{}, &EngadgetPost{}); err != nil {
    		t.Fatalf("failed to auto migrate, got error: %v", err)
    	}
    
    	for _, name := range []string{"author_id", "author_name", "author_email"} {
    		if !DB.Migrator().HasColumn(&EngadgetPost{}, name) {
    			t.Errorf("should has prefixed column %v", name)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Oct 26 03:58:13 GMT 2023
    - 7.3K bytes
    - Viewed (0)
  7. tests/update_has_one_test.go

    			Account CustomizeAccount `gorm:"foreignkey:UserID"`
    		}
    
    		DB.Migrator().DropTable(&CustomizeUser{})
    		DB.Migrator().DropTable(&CustomizeAccount{})
    
    		if err := DB.AutoMigrate(&CustomizeUser{}); err != nil {
    			t.Fatalf("failed to migrate, got error: %v", err)
    		}
    		if err := DB.AutoMigrate(&CustomizeAccount{}); err != nil {
    			t.Fatalf("failed to migrate, got error: %v", err)
    		}
    
    		number := "number-has-one-associations"
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jul 14 06:55:54 GMT 2022
    - 3.6K bytes
    - Viewed (0)
  8. tests/hooks_test.go

    }
    
    func TestRunCallbacks(t *testing.T) {
    	DB.Migrator().DropTable(&Product{})
    	DB.AutoMigrate(&Product{})
    
    	p := Product{Code: "unique_code", Price: 100}
    	DB.Save(&p)
    
    	if !reflect.DeepEqual(p.GetCallTimes(), []int64{1, 1, 0, 1, 1, 0, 0, 0, 0}) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Feb 18 01:20:29 GMT 2023
    - 15.9K bytes
    - Viewed (0)
  9. istioctl/pkg/writer/ztunnel/configdump/configdump.go

    	ztunnelDump *ZtunnelDump
    	FullDump    []byte
    }
    
    // Prime loads the config dump into the writer ready for printing
    func (c *ConfigWriter) Prime(b []byte) error {
    	cd := ZtunnelDump{}
    	// TODO(fisherxu): migrate this to jsonpb when issue fixed in golang
    	// Issue to track -> https://github.com/golang/protobuf/issues/632
    	err := json.Unmarshal(b, &cd)
    	if err != nil {
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Tue Apr 23 21:30:30 GMT 2024
    - 2.8K bytes
    - Viewed (0)
  10. migrator/index.go

    package migrator
    
    import "database/sql"
    
    // Index implements gorm.Index interface
    type Index struct {
    	TableName       string
    	NameValue       string
    	ColumnList      []string
    	PrimaryKeyValue sql.NullBool
    	UniqueValue     sql.NullBool
    	OptionValue     string
    }
    
    // Table return the table name of the index.
    func (idx Index) Table() string {
    	return idx.TableName
    }
    
    // Name return the name of the index.
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Apr 11 02:32:46 GMT 2023
    - 1023 bytes
    - Viewed (0)
Back to top