1Rose::DB::Object::MetadUastear::CUonnitqruiebKuetye(d3R)Poesrel::DDoBc:u:mOebnjteactti:o:nMetadata::UniqueKey(3)
2
3
4
6 Rose::DB::Object::Metadata::UniqueKey - Unique key metadata.
7
9 use Rose::DB::Object::Metadata::UniqueKey;
10
11 $uk = Rose::DB::Object::Metadata::UniqueKey->new(
12 columns => [ 'name', 'color' ]);
13
14 MyClass->meta->add_unique_key($uk);
15 ...
16
18 Objects of this class store and manipulate metadata for unique keys in
19 a database table. Each unique key is made up of one or more columns.
20
22 add_column [COLUMNS]
23 This method is an alias for the add_columns method.
24
25 add_columns [COLUMNS]
26 Add COLUMNS to the list of columns that make up the unique key.
27 COLUMNS must be a list or reference to an array of column names or
28 Rose::DB::Object::Metadata::Column-derived objects.
29
30 columns [COLUMNS]
31 Get or set the list of columns that make up the unique key.
32 COLUMNS must a list or reference to an array of column names or
33 Rose::DB::Object::Metadata::Column-derived objects.
34
35 This method returns all of the columns that make up the unique key.
36 Each column is a Rose::DB::Object::Metadata::Column-derived column
37 object if the unique key's parent has a column object with the same
38 name, or just the column name otherwise. In scalar context, a
39 reference to an array of columns is returned. In list context, a
40 list is returned.
41
42 column_names
43 Returns a list (in list context) or reference to an array (in
44 scalar context) of the names of the columns that make up the unique
45 key.
46
47 delete_columns
48 Delete the entire list of columns that make up the unique key.
49
50 name [NAME]
51 Get or set the name of the unique key. This name should be unique
52 among all unique keys for a given table. Traditionally, it is the
53 name of the index that the database uses to maintain the unique
54 key, but practices vary. If left undefined, the default value is a
55 string created by joining the column_names with underscores.
56
57 parent [META]
58 Get or set the Rose::DB::Object::Metadata-derived object that this
59 unique key belongs to.
60
62 John C. Siracusa (siracusa@gmail.com)
63
65 Copyright (c) 2010 by John C. Siracusa. All rights reserved. This
66 program is free software; you can redistribute it and/or modify it
67 under the same terms as Perl itself.
68
69
70
71perl v5.38.0 2023-R0o7s-e2:1:DB::Object::Metadata::UniqueKey(3)